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
In this blog, we are learning that the ‘Downgradable permissions’ in Android apps. You can disable runtime permissions that your app no longer needs on Android 13 (API level 33) and higher. Perform this action when you update your app so that users are more likely to comprehend why your program keeps asking for particular permissions.
Use the command revokeSelfPermissionOnKill(String) to revoke ONE privilege.Use revokeSelfPermissionsOnKill(Collection) to revoke MULTIPLE permissions.
Next, in our AndroidManifest.xml file, we must define a few runtime permissions. In our app, these permissions will be requested at runtime. We will use the MANAGE_EXTERNAL_STORAGE and ACCESS_FINE_LOCATION permissions in this post.
We have added these run time permission in the manifest file, now we are creating the XML layout to show the button to Permission GRANT or REVOKE.
In this code, we are seeing, we have created two buttons first one to give all required permissions, and the second one is to revoke all given permissions.
MainActivity.kt
We are creating a permissions list.
now we are declaring the permission request code and the revoke code.
Remember that the permissions that have been revoked MUST BE GRANTED FIRST! The methods will throw an Exception if not.
Congratulations!! 🤩 You have mastered the Android 13 Downgradable Permissions.
Visit the link for additional information on the Downgradable Permissions in Android 13.
Thanks for reading this blog. You can also check other blogs from here for more knowledge.
Always be ready for learning 🙂
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
Name
Email
Subject
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.