Android 13 – How to request WRITE_EXTERNAL_STORAGE

TLDR: You don’t.

From Google’s official documentation:

“If your app targets Android 11, both the WRITE_EXTERNAL_STORAGE permission and the WRITE_MEDIA_STORAGE privileged permission no longer provide any additional access.”

So in effect, if you were to request WRITE_EXTERNAL_STORAGE on Android 11 or later, you would be requesting nothing. This is the whole point of Android’s migration to scoped storage, which effectively prevents apps from reading or writing to the storage directories of other apps UNLESS they are accessing specific file types (e.g. media, using the permissions you mentioned) or are granted special file manager permissions by Google themselves. For more insight into scoped storage, see this well written article, but TLDR security and leftover files from app uninstalls were the big reasons Google did this.

So if you really want to write files, either make sure you’re only writing to your app’s designated storage directories, in which case you won’t need any permissions at all, or if you really need to write to a directory your app doesn’t own get that file manager permission from Google (how to get that permission)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)