Humpty Promotes > Rfo-Basic > Project Articles > Scoped Storage

Android Scoped Storage

This whine is a modified summary of a post on a forum explaining Android Scoped Storage.

External Storage
Private Storage
Internal Storage
Google kills off Shared storage


Here is a map of Android Storage I made in 2015.
It maps an overview of the different areas of storage found on an Android device.

What is External storage ?
For a long time now,  many apps have used External Storage.
This has either been on
     Primary      External Shared storage (sdcard)
or  Secondary External Shared storage (removable sdcard).

Since Android 11, Google has been enforcing Scoped Storage.
This forced developers to move their apps to
      Primary     External Private storage (sdcard)
or  Secondary External Private storage (removable sdcard).
i.e this is how apps can be scoped.

What is Private storage ?
The word 'Private' has become synonymous with 'Scoped'.
These are areas where nobody but your app can access.
Google wants each app to get scoped, so that they cannot see each other.

What is Internal storage ?
There is also another area called Internal Storage which a fewer number of apps use.
This storage is also Private and has been there since the beginning of Android.
Not many apps used it because it was a small area (expensive in those days) and because they were 'scoped' (i.e private).
So most apps chose to use External instead where shared storage areas were more plentiful and easily shared between apps.

The greatest confusion for users has been the difference between 'Internal Storage' and 'External storage'.
Modern phones emulate the primary sdcard using 'internal' storage, and this is where the word gets confused.
Even though an 'sdcard' uses 'internal' (fast) storage, it is still classified as 'External'.
True Internal Storage, is not emulated, and has always been Private storage (not Shared).
Any type of Private storage is also removed after the app is uninstalled.

Google slowly killed off Shared storage
Shared storage are those areas where apps can see each other's files with read and write access.
There are fewer areas where apps can freely share storage.
Infact, according to the documentation apps are not even allowed to write to Download unless there is already a subdirectory waiting for it there.

The official way to share storage is to use special APIs like File-Provider or Media Collections.
These allow access 'per file', they cannot share whole directories.
And even then, there are rules to write-access depending whether it was your app that created the file.
And you cannot access them via normal libraries. You have to send an intent..etc
In short, they are a real pain to implement.

For now, the easiest way to copy files between different areas is with file-managers which know how to get access
e.g  Total-Commander.

All apps that have been compiled for Android 11 and higher (Target API 30+) are forced to be scoped. Apps can no longer access areas outside of their own scoped storage.
As a simple example;
Where before we could open any .html file on your phone with a web browser and browse via a link to any other .html file in the same directory. You can no longer do this any more.
The directory does not belong to the web browser app.
Even if you properly shared the first .html file to the browser, the second file was not shared with the first file, so the second file cannot be accessed. In scoped storage, directories cannot be shared.




Leading Cloud Surveillance, Recording and Storage service; IP camera live viewing

Leading Enterprise Cloud IT Service; cloud file server, FTP Hosting, Online Storage, Backup and Sharing

Powered by FirstCloudIT.com, a division of DriveHQ, the leading Cloud IT and Cloud Surveillance Service provider since 2003.