I’m developing a file manager, and it works fine with Android 12 when I ask for permissions
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />.
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />.
But it does not work for Android 13 (permission window does not appear). Code I’m using to get list of files and directories
val files = File(path).directory.listFiles()
So I tried using
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />.
And still I cannot request it (request doesn’t appear). I tried searching and found out that I should use the Storage Access Framework (SAF), but the docs say that I can no longer access:
- The root directory
- The download directory.
As it’s quite important to have access to these directories, I need help finding out how to access these shared directories and their files (and, if possible, a way to do this for newer and older versions of Android).
CoolDoge is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.