Customize permissions in compose with Activity Result APIs
Mozhdeh Nouri Sarani
Android Developer : Kotlin | Mentor | Technical Knowledge Sharing | Team Player
requirement: knowing about Activity Result APIs
The most significant challenge in working with permissions is ensuring that permissions are correctly checked across different versions of Android. For instance, to access the phone's gallery, two distinct types of permissions are provided. In Android 13 and above, our access differs from that in Android 12 and below. In such cases, it is essential to first ascertain the Android version, then identify the appropriate permission for that version, and finally, if necessary, request permission from the user.
When your app has lots of permissions managing them can be a little bit complex on each screen. The best solution is to Customize each permission in a separate file and then use them in your screens or composables.
See this link for all implementations with details and use cases.