MFile - a modified version of Sunny's `EFile` extension - Shared folders - storage permissions - Android 11+

Now compiled, but I can not read the file, my screen is blank, no errors

Probably you didn't grant read storage permission.

before being able to read it (in Screen.Initialize) you first should save the file
or: only read the file if it already exists
Taifun

The file allready exist, the project runs well with companion, I'm wondering why I should use this extension instead of using file component

Post the aia. Which Android version?

... and read this:

on first run of the app the file can't already exist in event Screen.Initialize
and if it exists, then it was not created by your app...
in this case you only can use SAF to read it...see again the overview by @Anke

Taifun

I'm wondering why I should use this extension instead of file component with Android 11
Shared_Mfile.aia (40.1 KB)

because of the bugs in the file component, see the first post in this thread

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.

Taifun


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

1 Like

see post 24

Everything necessary (and more) on this has already been said several times.
I have nothing to add.

:cry: :cry: :cry: may be I did not understand what you said

Then read again.

are you still not able to compile your project?
feel free to use the file component

Taifun

I can compile now, but I don't understand the advantages of mfile ext over file component.
I thought mfile could read a text file created by another app in the shared folders

You may want to try SAF for reading a file created by other app.

I would gladly use saf if it was possible to avoid the file list, I already know the location of my file

you are again asking the same questions, which already have been answered...
it does not look like you read the first post in this thread as previously suggested...

Conclusion
As long as the bugs with the File component are not fixed, I recommend using this extension (MFile), at least on Android 11+.

But if you want to stick with the File component, you MUST ALWAYS set DefaultFileScope to Legacy. Otherwise it will not work on Android 11+ or you MUST save in the ASD or PrivateDir (internal storage).

Taifun

2 Likes

I'm asking the same questions, all you are repeating the same answer, no one tries to explain to me in other words

What about telling us, what exactly you do not understand after reading the answer?

Taifun

1 Like