How to download a file to the ASD with any Android version

To download a file (test.csv, 1KB) from the Internet to the ASD with any Android version:

grafik

To check this on any device (especially on Android 10 / 11):

Extensions:

1 Like

Note:

You get the same result with this:

However, the File component needs the forward slash (/test.csv)


because it can also save in / read from the Private directory (→ internal storage).
So if there is no slash at the beginning the file is saved / read in / from the Private dir:

/data/user/0/<packageName>/files/

See also here (→ 1.2):

1 Like

I tested Anke aia with android 10, it does not work

Hi Patel,

I think that Anke may be using the legacy version of ReadFile - If you tick the Legacy Box it should work for you. It did for me and I'm using Android 10. It will probably stop working when Android 11 takes over but there may be a solution then for reading from external data files based on the kind of approach used for reading media files. I hope so anyway!

Yes, you are right, It works, thank you.

Good to hear and for later versions that must meet the Android 11 requirements I think we will need to store data files on the web using resources such as Google Drive and then download them using the web component Anke demonstrates in the example above.

I said OK too soon, when i'm using companion I can read and save, then I compile apk, run the app, I can read but not save, no error while saving, but no changes in file.

Which aia? Please post in / on the relevant topic.

I'm sorry, but I can not find the topic, your aia is listCsv.aia (32.5 KB)

Search for "listCsv.aia":

I tested Anke aia with android 10, it does not work, then after PeterO suggestion I ticked the Legacy Box and it worked with companion but not compiled, this is my code
blocks(1)
When I try to save, no error but no file changes

Check it again: listCsv2.aia (32.6 KB)
Build the APK and try on your Android 10 device.

Blocks

So it seems that you are talking about your own app, not my aia.

1 Like

Thank you Anke, the new aia runs very well, after adding permission request also my project runs well.
So to save text files with android 10 it is not necessary to use the private folder, but I can use a folder in /

1 Like

now moved to the correct thread...
Taifun

2 Likes