Access non-media and media files on Android 11+

Access to non-media files on Android 11+

On Android 11+, non-media files (like txt, pdf, csv, …) can be accessed
if and only if

  1. the text files are in the → ASD or in the → Private dir (i.e. were saved there), or
  2. the text files are in one of the Shared folders /Documents or /Download and
    these files were created by the app itself, or
  3. SAF is used, or
  4. MANAGE_EXTERNAL_STORAGE* permission is requested and granted.

*` This is not really an option, because an app that requests this permission will (most likely) not be allowed in Google’s Play Store.

Note: Of course, all files in the assets can be read. However these are read only.

Access to media files on Android 11+

Without READ permission, media files (like jpg, png, mp3, mp4, …) can be read on Android 11+
if and only if

  1. these files are located in one of the Shared folders (/Pictures, /DCIM, /Documents, /Download, /Music, /Movies) and were created by the app itself, or
  2. these are in the ASD or
  3. these are in the Private directory.

With READ permission, all media files can be read from all areas of the external storage (also from the root dir).

Without WRITE permission, media files can be saved on Android 11+
if and only if

  1. these are stored in the ASD or
  2. these are stored in Private dir or
  3. these are stored in one of the Shared folders.

The Private directory is in the internal storage:

/data/user/0/<packageName>/files/

Note: Since WRITE_EXTERNAL_STORAGE permission no longer exists on Android 11+, without MANAGE_EXTERNAL_STORAGE there is no way to save files outside of the ASD, Private dir or Shared folders. Or you must use SAF.

For more details see also here:

6 Likes