-
Notifications
You must be signed in to change notification settings - Fork 0
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 inandroid-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
inexternal storage
anddoes not need a permission
.
- We can perform this action using
createWriteRequest
,createDeleteRequest
and modify the files in the directory created by other applications inexternal storage
- But the catch here is, it requires the approval of the user.
- We can now
move the files to the trash
instead ofdeleting them
. - We can recover the items from the trash in a
30-days
life span.
- 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.