E
E
Eugene2021-12-25 14:33:04
Android
Eugene, 2021-12-25 14:33:04

How to get full access to files in Android 11 external memory?

In Android 11, the getExternalStorageDirectory method that returns the path to external memory is deprecated. Instead, there are new APIs for working with specific public or application folders.
But for a work task, I need to work with folders and files that are in the root of external memory. I did not find an example of a new API that would allow this. In the Google documentation, in fact, there is only how to get permission (via ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION), there are no problems with this. In addition to working with files from Kotlin, I also need to interact with files from C ++. There are no problems with the outdated API, there you can get the full paths to the files and do whatever you want with them. But what about new APIs? Or to score and use the old one, hoping that it will not be cut out in the next versions?
PS The application will not go to the market, so I can get any permissions and do whatever I want.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question