Csv files , when generating the apk, it is not reading the 2 csv files, only one when using it on the cell phone

how to generate apk with 2 csv files,
after generation it's only reading a csv

What have you tried? If you share then ppl will suggests you the best one

By using index method we can read the multiple csv files one by one and store the respective file text either in variable or tinydb to use it further

Here is a sample showing how to load multiple csv files at app startup ...

1 Like

Where are the files Joao? Stored in your App Media (Assets) or in an external directory?

Post an image of the Blocks that load/read the CSV files into the App. You only mention APK - is the issue the same when tested in the Companion?

image
image

Try to use the same name of csv files in app..

Also another one, in app asset small letter is there but in app capital app is there

That is nonsense Spicy, the function does not need to have a related name, never mind the same name.

Two ways / options:

1. With 2 File components

2. With 1 File component

Hi Joao

Safer not read files in Screen Initialize.
So like this:
ReadFiles.aia (7.5 KB)

Why?

Of course, this also works well (regardless of how big the files may be):

It can simply fail - too many 'big' tasks in Screen Initialisation. There are other Topics on this.

For example?
I tested this on different devices and Android versions without any issues (also with big files).

2 Likes

It's a combination of the number of items in the Block, how 'heavy' they are and how well the device can process them. Clearly it's best to avoid a potential issue rather than to 'wing it'.

I have 19 real Android test devices with almost all common Android versions (4.x, 5.x, 7.x, 8.x, 9, 10, 11, 12, 13) and different CPU power and RAM (1GB - 6GB ). Unless I have an app that has trouble with this, I doubt there are any issues at all.

You can doubt all you like Anke :koala:

Reading a file works asynchronously and is done in another thread without impact on the UI thread

I therefore currently can't think of any reason why start reading a file in the Screen.Initialize event should be avoided

Taifun

1 Like