Savefile Android 9

Hi,
It´s no possible for me to save and read files in a system Android 9. I allways get the message: No exists
I have read serveral topics and I have tried this, but it doesn´t work. Cuould anyone help me? Any example?
Another problem also occurs, when I choose defaoult scope : shared, the app is closed, quits itself. thanks


imagen

If you are using the ASD, why not just set the DefaultScope to App, and then read abcd.txt?

The File component needs / uses a relative path for the Scopes Legacy & Shared.

1 Like

It doesn´t work.

Do not include a slash "/". In any cases, a slash indicates a media file. When you attempt to write to a media file, basically it will end up in failure.

This is incorrect.

Greatly simplified explanation: No slash refers to a file in the app's private area, and is writeable, a single slash refers to a file in the app's ASD, which is writeable, a double slash refers to an asset (media file), which is read only.

1 Like

Hi Anke,
I don´t have the option MakeFullPath.....
Thanks

:question:

Hi Gordon_Lu,
I have tried it, but not works....

Sorry, I mistook the problem.

Check Anke's solution. What server/website are you using? The code.appinventor.mit.edu one?

Sorry, I have it. Needs, more time to be shown

1 Like

Bingo!!! Now exists!!!
Thank you very much.
Thanks Anke


imagen

No not at all:

Wait...why are you providing a full path?

Also for the ASD storage permissions are not required on Android ≥ 4.4 (API 19).

grafik

Hi,
I have problems to read one file created. The file is detected like existing
, but appears error 2101 with message : the file could not be found.
File1, scope App, read and write permissions.
??
I would appreciate your advice



File_Write_Read.aia (3.0 KB)

Check this aia and you will (hopefully) understand:
File_Write_Read_2.aia (2.7 KB)

Hi Anke,
fortunately I have come to understand!
Thank you