Download, Read and Search csv file

Hi at all!
I am creating a project to scan the warehouse codes.
I would like to create an application that allows me to read barcodes and find the result in a csv file.
I had thought of such a thing:

  • download the updated CSV file from GDrive
  • scan the barcode
  • I look for the correspondence of the scan code in the downloaded csv file
  • have the second or third line of the csv as an answer

Can help me?
Thanks

Perhaps something like this:

  • Fetch File by File - #14 by TIMAI2
  • Search community for QRcodes. Use the advice to scan the code and retrieve a bar code value.
  • convert csv to a List, then search the List for the bar code

What have you tried? What you need to do depends on your familiarity with App Inventor.

Here are some resources to help you learn to use the AI2 tools. A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook App Inventor 2 Book: Create Your Own Android Apps ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks.

There is a free programming course here Course In A Box and the aia files for the projects in the book are here: App Inventor 2 Book: Create Your Own Android Apps

How to do a lot of basic things with App Inventor are described here: How do you...? .

Also look here App inventor español. Offline. Tutorial. Ejemplos. Instalación. Códigos. Juegos. Curso gratis de App inventor. and here Tutorial Index | Imagnity for more tutorials.

Learn about components Component Reference
and visit the Library The MIT App Inventor Library: Documentation & Support Help>Library on the MENU

1 Like

I've already built a few apps with AI2 so I'm a bit familiar with programming.
For now I have created these blocks:


The first problem I encountered is downloading the GDrive file, AI2 downloads me a file with .tmp extension and I don't understand where the error is.
I have already created the method of reading with barcode and I can get the result of the reading carried out.

Try to use as url https://drive.google.com/uc?export=download&id=your_spredsheetID_here and see if it works for you

Not work, the file downloed is ".html". :thinking:

Btw, this should work without storage permissions (WRITE) on API ≥ 19 (KitKat, Android 4.4+) .

With this method the file is downloaded successfully.
Now the problem is in the read and write permissions which are not allowed. I try with "android.permission.READ_EXTERNAL_STORAGE" and "READ_EXTERNAL_STORAGE"

How should I do?

Set DefaultFileScope to Legacy in the Designer.

grafik

The file not found, but in the folder exist.

The file open correctly.

Now I would like to create a list view with the data inside the csv file.
Then, with the barcode scanner, enter the scanned text in the search bar of the listview.
How do i do it?

I was able to read the csv file and put it in a listview. I enclose the blocks in case someone might need them.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.