Access to non-media files on Android 11+
On Android 11+, non-media files (like
txt
,csv
, ...) can be accessed
if and only if
- the text files are in the →
ASD
or in the →Private
dir (i.e. were saved there), or- the text files are in one of the
Shared
folders/Documents
or/Download
and
these files were created by the app itself, orSAF
is used, orMANAGE_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
- these files are located in one of the
Shared
folders (/Pictures
,/DCIM
,/Documents
,/Download
,/Music
,/Movies
) and were created by the app itself, or- these are in the ASD or
- 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
- these are stored in the
ASD
or- these are stored in
Private
dir or- 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: