Some basics on Android storage system

If you are asking for help, I recommend you to make it as easy for others to be able to help you ...
You probably will get more feedback then...

which means in your case post a screenshot of your relevant blocks...

To download the aia file, upload it to App Inventor, open it, do some bug hunting for you, etc... this takes time, and most people will not do that...
Thank you.

did you read the first post in this thread? here it is

you will have to store it in a valid directory for shared storage, which is for example /Download, /Documents, /DCIM, /Music

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

That means it's impossible to show those files in a file manager !?

Ok, but it's strange we are able to write a file in a location we can't read from no ?

correct, see also the documentation Storage

which Android version are you using for your tests?
any screenshot of your relevant blocks?
how did you test? using the companion app? using the apk file? try again using the apk file...

Taifun

Yes, that would really be strange. But this is not the case, I'm sure.
Post your blocks and the aia (or a test aia). Also mention the Android version you're testing on and whether it's with Companion or the APK.

Sorry, i realise that the aia file i shared in my post had to many blocks to understant what happen.
so you will find here a very simplest one.
shared_File.aia (34,0 Ko)

fisrt button to save file in shared (directly in emulated/0)
second one to check file exist
and third one to read it.

when I test it, file is saved and i can check it, but when i try to read it app bugs ans stops.
same in companion or with apk

I can see and open it with my file manager:

Android version: 10 QKQ1.191014.001 on redmi 7A

There are some bugs with the File comp. Try with FileScope = Legacy instead of Shared.

As I said, with Legacy I can write and read the file but without been able to see it with file manager...
So i'm interested with Shared and possibility to have my file in emulated/0/.
But i think it'is strange to be able to write a file where we can't read it (in external SD it seems we can read but not write) it becomes difficult to undertand any logic !

Your tst.txt file is not in a shared folder, then you can not read write without this

You probably cited the wrong message.. in fact also my msg started eith "sorry.. " but my txt cvs file actually was in Download and file not worked with the apk..
However i happyly solved with the saf extension.

His device has Android 10 and there you can write/read to/from the root dir of the ext. storage with storage permissions (and also to any other locations exept the ASD of other apps & the MicroSDcard).

I have try this
image
but permission is not in label2 so i have no pemission1.SdkVersion>30...

but here i can't read in shared...

We won't get any further like this.
Post the aia (or rather a simple test aia) and the blocks.

is this not simple enougth ?
it just write check and read the file ! I don't know how do simplest...

Try this one:
shared_File_2.aia (34.2 KB)

It will not work on Android 11+ because of the known bug of the File comp. regarding storage permissions. Use instead my MFile ext.

well...it works fine, but i have to say that i'm surprised :
file is saved in shared (which is emulated/0) and it is read in Legacy !
how strange is it !
I just can thank you again (and lot) for your help, but i'm disappointed because i don't understand...

There is nothing to understand. It's just another bug (often mentioned by me). And there are some with the File comp.

For more details on this, read here:

Well... i have read so many posts on storage that i am completly confused !
This point is particulary complicated in Android: it depends on the version on the scope, if you use / // or no /, each time it use a différent path and possibilities (read,write, permissions...)

for my mind this type of presentation find in your last link is the more readable to understand and memorise all informations:
image
unfortunatly it is a first try and not all informations i talked are in...
maybe we need one for each android version.
I will try to build such a table, but for now i'm afraid to not have enougth informations, not have a good understanding about all of this and i'm too confused...

1 Like

and now your goal is to confuse everyone?
in your screenshots you are using the file component, now you are talking about blank images? the purpose of the file component is to work with text files!
your table does not help anyone...
if there are any doubts, then why not providing a screenshot of some relevant blocks... also tell us what you are expecting and what happens instead

Taifun

1 Like

? why are you talking about blank image ?
it is not the same for other files ?
maybe i missunderstood..sorry.

oh year ! that's it ! very clear!
just missing behaviour in removable SD card.