File component and EFile extension - storage permissions - Shared folder - Android 11+

I had a (internal) discussion on the AI2 forum with some Power Users about the File component and the EFile extension (from @Sunny_Gupta) regarding storage permissions. Here is a small test app that shows the problems. The same issues exist on Niotron.

Here is the test app (build with Niotron). It’s a simple app that save a text file in the Shared folder /Download and read it (this should work without storage permissions):
File_EFile_test_Nio.apk (4.6 MB)

I think everyone is interested in this, so I’m opening a new topic here for it.

Install the test app and do not grant storage permission when testing on Android 11+.
(Test order: Button 1, 2, 3).

  1. When clicking on Button1 everything should work (as it should, i.e. without permissions) on Android 11+.

  2. On Android 11+ you will be asked to grant storage permission after clicking Button2 and Button3. If you deny permission on Button2 you get the same result as if you had granted permission.

  3. When clicking on Button3, the well-known “Error 908: ...” (bug) appears if permission was denied.

Maybe the Niotron team can fix this problem (bug) with the File component (on Android 11+).

4 Likes

want to acess /storage/emulated/0/Download in all Android version and I am confused how to acess it for all Android version?
in android 11 read external storage permission granted using ask permission but when i ask for write permission it triggers denied event.

so can this extension help in this?

Show your relevant blocks.


Did you try my MFile extension?
See also here: How to access non-media & media files on Android 11+
MFile - a modified version of Sunny's EFile extension - Shared folders - storage permissions - Android 11+

@Anke only want to create my app folder in /Download like /Download/MyFolder
in this folder I want to store PDF files which are generated by my app.

my real problem is I don’t have 11+ device. :confused:

currently I didn’t used @Anke your extension.
and that’s why I am asking any permission needed to my app for doing this work for all Android versions

  • If API < 30 then request WRITE permission.
  • Use the File component to create a sub-folder “myFolder” in /Download.
  • Create PDF files and save them in this subfolder /Download/myFolder/.
  • On Android 11+ no storage permissions are needed.
  • To be able to read (access) the PDF files on Android < 11, READ permission is required. However, this is automatically granted once WRITE is granted.
2 Likes

Thank You for your valuable reply @Anke.