How to request and grant MANAGE_EXTERNAL_STORAGE permission

CREATE FILE AS PER MRS ANKE METHOD .aia (63.9 KB)
my aia file attached thanks mrs Anke

Hello,
I have tried AS IS the app CREATE FILE AS PER MRS ANKE METHOD by KHALED_MOSTAFA on my Android 14 phone (Realme GT 6). It works fine, but when I copy the text file, I get READ_EXTERNAL_STORAGE permission denied error, but the file is eventually copied successfully. As natural, I granted any read/write file permission to this app in its operating system settings.
In am really interested in finding a solution to such issue, as I have several old apps that are no longer working on new Android version and that I need to make running again.
Any help will be very appreciated.

Did you use the File component? Some methods mistakenly request READ permission. Try to use one of the File extensions from @Taifun or @vknow360 instead.

Hi Anke, thank you for your prompt feedback.
The app already uses Taifun file extension to copy the file, it is there indeed I get the error:

Per your suggestion, is it possible the error comes from MakeFullPath or Exists method of File component (used in the Copied event)?

Try the TaifunFile.Exists method instead:

Can you give little explanation about what you did here with these blocks?

Great I still have hope...... onces I have learn how to fix this file save and call issues..I am triying to adjust my old proyects.
I have 2 app: one for starage of a csv file, the other to take that files and send it to a web app (app script in drive) that the will place the information a GSS.

If I understood correctly, you came also with some SAF extension , please direct me to your versions and tutorials in order to learn

best regards
LuisMa

Please do not spam the community
You do not need SAF, just follow my already given answer here

Just try it...

Taifun

1 Like

Is this latest?

This is all you need


taken from How to request and grant MANAGE_EXTERNAL_STORAGE permission - #4 by patel

Taifun

1 Like

Yes, it worked now.

which permission is it? Any screenshot?
how do you work with that extension? Some screenshots might help...

Taifun

just ask for MANAGE_EXTERNAL_STORAGE permission only once
you can store a flag in TinyDB after the permission has been granted

Taifun

ok, thank you very much

I now added a method into my tools extension, which can check, if manage external storage opermission already has been granted

HasManage

You can download the tools extension in the Download section here App Inventor Extensions: Tools | Pura Vida Apps

Example use

@Anke might want to add that method into her All Files Permission extension

  @SimpleFunction(description = "Checks, if MANAGE_STORAGE_PERMISSION has been granted. Returns true or false.")
  public boolean HasManageStoragePermission() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
      if (Environment.isExternalStorageManager())
        return true;
      else
        return false;
    } else
      return true;
  }

Taifun

1 Like

Thank you very much Taifun!You are phantastic.

Did I already say?

There is a good wind blowing, if Taifun comes up. :wink:

grafik

grafik