Forum > Android

How to display a CSV file in a GridView

(1/2) > >>

maurobio:
Dear ALL,

I am trying, most unsuccessfully, to display a simple CSV file using a jGridView on an Android app.

My demo app has a jGridView and two buttons, one for loading the CSV file and populating the grid with its contents, and another for just closing the app.

I am using a simple generic function to read the CSV file and load it into the grid, but somewhere the code is not working - the app simply closes when the "Load" button is clicked. I cannot grasp the nature of the error, but I suspect it occurs because the app cannot find the CSV file. And this raises the question: where should that file be placed, so that it can be read by the app (and also being packed in the apk file)? Some wallahs say that it should go in an 'assets' folder inside the app folder, where other wizards say it should go in a 'raw' folder also inside the app folder. I am, of course, at a lost!

Could someone help with that? I believe that should offer a nice and useful example for all (perhaps even to be included in the LAMW 'demos' gallery)!

My demo app is attached (stripped of some folders because of the file size limitation for the attachments here in the forum).

BTW: Ideally, the grid should be as visually attractive as this one shown here: https://forum.lazarus.freepascal.org/index.php?topic=39290.0  ;)

Thanks in advance!

With best regards,

jmpessoa:

--- Quote ---I am trying, most unsuccessfully, to display a simple CSV file using a jGridView on an Android app.....

--- End quote ---

jGridView  is an "indomitable" control.... Maybe you can try   "jTablelayout"  (there is a demo)


--- Quote ---Some wallahs say that it should go in an 'assets' folder inside the app folder, where other wizards say it should go in a 'raw' folder also inside the app folder....

--- End quote ---

Use "assets" to package files that won't change by the app user....

maurobio:
Hi, @jmpessoa!

The jTableLayout component is not present in my version of LAMW, I would have to upgrade before trying it.

Best regards,

jmpessoa:


Look for it into "Android Bridges"  palette (the 5o. from last to first)

maurobio:
Hi, @jmpessoa!

jTableLayout is not in my currently installed version of LAMW (2.0.12). I will have to upgrade.

Best regards,

Navigation

[0] Message Index

[#] Next page

Go to full version