Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android 11 doesn't create app directory on external storage

Lately I updated my smartphone to Android 11 and I noticed that one of my app crashes on creating directory on external storage. I have read Android 11 documentation and here we are Starting in Android 11, apps cannot create their own app-specific directory on external storage. Quite strange because when I open Android/data dir there are a lot of applications folders so there is possibility to do it or maybe there are folders created by apps before updates ?

like image 939
KyluAce Avatar asked Sep 24 '20 10:09

KyluAce


People also ask

Why does Android 11 have restrictions file manager?

To protect user privacy, on devices that run Android 11 or higher, the system further restricts your app's access to other apps' private directories.

How do I access app files on Android 11?

Please go to Android system settings, find storage section, click it. From the storage page, find "Files" item, and click it. If there are multiple file managers to open it, please make sure to choose "Open with Files" to open it, which is the system file manager app.

How do I use scoped storage in Android 11?

Using scoped storage with FUSE. Android 11 or higher supports Filesystem in Userspace (FUSE), which enables the MediaProvider module to examine file operations in user space and to gate access to files based on the policy to allow, deny, or redact access.


Video Answer


1 Answers

getApplicationContext().getExternalFilesDir(""); will give you your app's specific external storage directory and no other apps will be able to access its contents. As i believe, what was meant by saying

Starting in Android 11, apps cannot create their own app-specific directory on external storage

is that no other app-specific directory can be created on external storage but the one forementioned. I found this article somewhat useful.

like image 133
Vladimir Rozin Avatar answered Oct 25 '22 14:10

Vladimir Rozin