How to request and grant MANAGE_EXTERNAL_STORAGE permission

In this guide I show you, how to request and grant → MANAGE_EXTERNAL_STORAGE on devices with Android 11+. Be aware that this permission is usually not granted by Google. However, let’s assume the app is only intended for private use or for special users or for other app stores.

This permission must be declared in the Manifest (since it is not declared the Companion app you can't test this with Companion):

<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>

Here is a small extension that declares this permission automatically in the Manifest (and let you check the API level of the device):
AllFilesPermission.aix (4.3 KB)

UPDATE (April 27, 2025): "HasAllFilesAccess" added, AllFilesPermission_2.aix

Currently you must still set → DefaultFileScope to → Legacy in the Designer.

EDIT on September 29, 2023: These blocks & the APK don't work since the nb193 release (targetSdkVersion= 33) on Android 13+ because there is another bug with the File component:

Blocks

EDIT: Google Drive link removed (since outdated)
https://drive.google.com/file/d/12JU9RLj-zvx5N4tUerLsl1Wm-ZZrYDyG/view?usp=sharing

New version since nb193 release (targetSdkVersion= 33). I used the MFile extension instead of the File component:

13 Likes
The permission Write_External_Storage has been denied
Help Me MANAGE_EXTERNAL_STORAGE for my app
Saving and reading files with android 11
SAF: App Inventor implementation of Storage Access Framework
List Documents folder with android 11
I got MANAGE_EXTERNAL_STORAGE permssion.I can write file,but I cann't read file
Can mit app inventor make a new folder in storage
How can i get internal storage access?
:stop_button: StorageAccess Extension: Simplifying Storage Permissions in MIT App Inventor
Reading CSV in App Inventor
Android per 11 12 error
Unresolved issue with Android 13+ permissions
How to access non-media & media files on Android 11+
Read .pdf File from Documents Folder
Options to read CSV external file into App
Comment effacer des images (How do you delete images?)
Permission denied bug
App with DB offline
How to access non-media & media files on Android 11+
RE: I want to open a pdf file in app inventor
Rejection of license
"Inquiry Regarding Rejection of My App on Google Play Due to External Storage Write Permission"
File reading problem with Android 11
File reading problem with Android 11
How do you get a list of nonmedia files with component "call file1.ListDirectory.."?
SAF1 - copy db.sqlite to ASD
Taifun File extension still works?
Cache cleaner app help
How do I find the same files?
SAF1 - copy db.sqlite to ASD
RE: I want to open a pdf file in app inventor
SAF1 - copy db.sqlite to ASD
Copying File from Download Folder to ASD
New/Modified Apps No Longer Work / Compile
Taifun File extension still works?
MFile - a modified version of Sunny's `EFile` extension - Shared folders - storage permissions - Android 11+
Confirm Existence of Directory?
How do you hide an image from user phone?
Spinner Textsize
Taifun File & Mit AI2 Update Target SDK
Listview works for mp3,jpg and pdf not html
1) Read .csv file from phone, 2) Seach for a keyword 'Apple4321' 3) If keyword found, then look for the nearest word if it is 'send' 4) If the word 'send' is found do some action like 'play music'
Trying to adjust an old project
MFile - a modified version of Sunny's `EFile` extension - Shared folders - storage permissions - Android 11+
Open Source • Background Tasks: Itoo 🚀
Lectura de pdf extension pura vida
Problem in permission
[Free] Image Convertor: extension to convert image format jpg / png / webp (and much much more)
How do you create a new file using file picker and write to it?
Write works on Motorola Android 15 but not on pixel9
Test php no result
Files and folders
How do you read from a txt file?
Taifun Camera Extension?
I'm having problems with the file system/file structure on Android/AI2

I can not read the complete text
android.settings.MANAGE_ALL_FILES_ACCESS_PERMISS.... ???

2 Likes
android.settings.MANAGE_ALL_FILES_ACCESS_PERMISSION
5 Likes

I tested Anke's extension with this blocks, it runs, I can read my file, but all times opens file access window.


How can I request permission first time only ?

my solution

After the permission is granted and you can save the text file e.g. in the root dir of the external storage, you can set Button1 to invisible since this is no longer needed:

2 Likes

Thank you Anke for sharing your knowhow

why blocks seem bit different to me :thinking:

What does that mean?

I think we need
blocks2

No, why?

UI of input for blocks seems different to me

Those are inlined, you can right-click on the block to inline it.

2 Likes

Here my blocks, if I don't use "if all tinyDB1.getvalue = false it shows all times access window

Here you'll find instruction how to patch the companion to get additional permissions: https://ullisroboterseite.de/android-ai2-faq.html?topic=patchcompanion

2 Likes

I can not understand how this patch can help to get manage permission

Add this line to the Manifest of the MIT_Companion.APK

    <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>

These are then all declared permissions:

Permissions
    <uses-feature android:name="android.hardware.bluetooth" android:required="false"/>
    <uses-feature android:name="android.hardware.location" android:required="false"/>
    <uses-feature android:name="android.hardware.telephony" android:required="false"/>
    <uses-feature android:name="android.hardware.location.network" android:required="false"/>
    <uses-feature android:name="android.hardware.location.gps" android:required="false"/>
    <uses-feature android:name="android.hardware.microphone" android:required="false"/>
    <uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
    <uses-feature android:name="android.hardware.camera" android:required="false"/>
    <uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
    <uses-feature android:name="android.hardware.wifi"/>
    <uses-permission android:name="android.permission.READ_CONTACTS"/>
    <uses-permission android:name="com.google.android.googleapps.permission.GOOGLE_AUTH"/>
    <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
    <uses-permission android:name="android.permission.CALL_PHONE"/>
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
    <uses-permission android:name="android.permission.NFC"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>
    <uses-permission android:name="android.permission.RECEIVE_SMS"/>
    <uses-permission android:name="android.permission.SEND_SMS"/>
    <uses-permission android:name="android.permission.VIBRATE"/>
    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.USE_CREDENTIALS"/>
    <uses-permission android:name="android.permission.READ_CALL_LOG"/>
    <uses-permission android:name="android.permission.ACCOUNT_MANAGER"/>
    <uses-permission android:name="com.google.android.apps.googlevoice.permission.RECEIVE_SMS"/>
    <uses-permission android:name="com.google.android.apps.googlevoice.permission.SEND_SMS"/>
    <uses-permission android:name="android.permission.CAMERA"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.BLUETOOTH"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>
    <uses-permission android:name="android.permission.READ_LOGS"/>
    <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>

If you use this version, you can also test your apps (that request MANAGE_EXTERNAL_STORAGE) with Companion.

But I need your extension for using installed app ?