Skip to content

How scoped storage is a solution to external storage drawbacks

Devrath edited this page Jun 7, 2021 · 2 revisions

Scope storage was introduced to increase user privacy and give the end-user the decision making step to control their privacy

  • Scoped storage was a solution to the problem.
  • Scoped storage is optional in android-10 but has become compulsory in android-11.
  • Because of scoped storage, System knows which application has created which file and has a track of each file, Thus when an application is uninstalled all the files that it created are also un-installed.
  • Every application has access to its directory in external storage and does not need a permission.

Modifying files in external storage created from other applications ?

  • We can perform this action using createWriteRequest, createDeleteRequest and modify the files in the directory created by other applications in external storage
  • But the catch here is, it requires the approval of the user.

Deleting the files

  • We can now move the files to the trash instead of deleting them.
  • We can recover the items from the trash in a 30-days life span.

Special applications that involve file handling

  • Some of the applications that are just developed to handle the files themselves need access to entire file system because that's the primary purpose of the application. How will that get handled is using special permission called.
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
  • If we add this permission, we do get access to the entire file folder.
  • But to add this to the play store, we need to follow a review process and approval from google justifying why this is permission is required.
  • After all the process, like any other permission, end users can disable the permission in the settings.