I have a csv file. The fields are delimited with ; (semicolon). It looks like this
Title;Description;Image-Name
Boat;Boat on the river;boat.jpg
Car;Sportscar in the mountains;car.jpg
Lake;Sunset over the lake;lake.jpg
I managed to read my csv. I can display the whole rows. However I cannot figure how to address the individual fields of each row. Can I iterate through these or do I need to apply a splitting looking for the ;?
So e.g. I want to show on my mobile the Title, I want to load the picture based on the jpg-name and below that I want to display the description.
How do I need to extend this textblock, to read e.g. only the jpg name into a variable that I can use later on for loading the picture?
Something like this should work on your csv file to return a list of lists to your app.
It relies on there being NO commas , in any of your fields, because the semi-colon ; is replaced to make a correct csv formatted file for AI2 to work with.
Thanks for your help. What I still don't understand is, how do I specificially address one field from the row? How can I get the "Description" from my row into a new variable, that I will then show alone?
I would expect something like for each item in row, do ...
Thanks
As mentioned in the end I want to read the rows from my CSV-File. I then want to show on a screen the Title, I want to load a stored picture based on the picture name and in one area I want to display the Description.
I have some randomize process that will triggered by a button and each time read from the list/file and show the content accordingly.
Good morning.
In my app I read a csv textfile with 80 lines in this format
Title,picture-name.png,descriptions about the picture
I read the lines in random order when a button is clicked.
I tested this with the companion. Everything worked fine.
When I created my first apk and installed it on the tablet, I found that the images are not loading or not showing. I cannot figure out what the issue is.
I have 80 images with a size of around 40 kb each. The image size in my app is defined with 300 x 300 pixels. I have also changed the size of my images to 300 x 300 pixels. I have assumed that I need to upload all images into the App Inventor and create then the APK. Questions:
What could be the issue?
I need this app only on one tablet. Is it an option to create the APK without the images I load via my csv file and instead place them directly in the app directory? If this is possible, how do I need to reference the path in my app? In the companion mode I had just // and all files where under the android companion files directory
Got it resolved. Just had to remove the // and everything is ok.
Maybe still the question: If I don't want to have the pictures as part of the APK and rather store them locally under the application folder. How do I need to reference them in my blocks so that the app finds them?
How, from your PC to the device or should they be downloaded to the device first?
If these are created by the app itself, no READ permission is required for Shared folders (like /Pictures).