Handling Multiple Permission using Jetpack Compose

Hi Friends todays we look in to how to handle multiple permission using Jetpack compose so in this example we use CAMERA and RECORD_AUDIO Permission

First we have to add google accompanist implementation in our app build gradle which make the permission process easy

Then we have too declare the listof() permission if you are going to use single permission then you can use rememberPermissionState()

After that by using permission state we get permission in string format by using that we can compare camera or Record Audio inside we have several when statement like got permission display granted if its denied for the first time we show the use of the permission and if they deny again then we display message mentioning that it has to be enabled on app settings

And i am launching that permission inside on start lifecyle

Final code

Knowledge is everything.Check out my app at https://play.google.com/store/apps/details?id=com.vibe.britevibe

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Domain-driven design in Android — Part 3

Handle LiveData Observer properly in ViewModel Testing

CREATING A NEW ANDROID PROJECT

Firebase Remote Config for app updates in Android

Explore SplashScreen API, Android 12, Kotlin

Day 33 — Improvements: adding limited ammo and a pickup

Integration of Huawei Account Kit and Location Kit in DuitManager

Android 12 — App Overlay Controls?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Pandiyan Mani

Pandiyan Mani

Knowledge is everything.Check out my app at https://play.google.com/store/apps/details?id=com.vibe.britevibe

More from Medium

Requesting Multiple Permissions in Jetpack Compose…

How to add WebView in Jetpack Compose

Navigation in Jetpack Compose using ViewModel state

Dirty sharing dependencies on jetpack compose