Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
Scoped storage was a feature introduced in Android Q(10). This is now mandatory from Android 11 that all apps targeting this version have scoped storage implemented, these new improvements have privacy in mind. In preview versions of android before Android 10, the runtime permission to read or write was required to access almost every file on disk, the Scoped storage feature is introduced mainly to avoid this situation. You can also check the official documentation: Click Here
From Android 11, the apps can use the scoped storage model can access only their own app-specific cache files. If your app needs to manage device storage check the below action to free the space.
1. Check for free space by invoking the ACTION_MANAGE_STORAGE intent action. 2. If there isn’t enough free space on the device, prompt the user to give your app consent to clear all caches. To do so, invoke the ACTION_CLEAR_APP_CACHE intent action(It might affect device battery life and might remove a large number of files from the device.).
Let’s write a sample code to access storage.
AndroidManifest.xml for permission:
ConstantHelpers.kt:
MainActivity.kt:
activity_main.xml:
string.xml:
dimens.xml:
. . . . . . . . .
That’s it from my side for today, thanks for reading it until now. You can check our other android blogs Click Here.
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
Great Product, Great Team, and Great Support Service. And if you want to add more features to the product, they can submit any idea that comes to your mind. They really care about their clients and we are really happy and honored to deal with Webkul.
Osama
USA
India
Global
Name
Email
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.