One of the best things about your videos is that you make mistakes and then fix it.. which shows everyone the kind of mistakes they can run into and see how to fix them. Thank your for your time and effort.
OMG, Phillip, you totally saved my project with this video. I had an issue with Bluetooth permissions for Android 12 OS. I thought, I tried everything, but your implementation of permission request totally worked in my case, thank you!
Hi Phillip, i really thank you for your contributions to the Android Dev community. I hope you will make some videos about MVVM + Clean Architecture + Modularization in the future. I think many people are interested in this topic.
Great video, but there's one problem, if the user had permanently declined a permission, goes to the app settings via the dialog and selects "ask every time", when he navigates back the "permanently denied" dialog is still shown and if he dismisses it, he won't see the prompt for permission again.
After learning how permissions are handled on iOS from your recent KMM Translator course, we on Android definitely have a much harder time implementing this!
As always, this is a really good content! I have a simple question: How do you deal with permissions that depend on different Android builds (e.g. Bluetooth permissions)? Do you create different arrays based on Android versions?
THANK YOU SO MUCH!!! PLEASE HELP I have created single activity by watching your Clean MVVM Notes video, it uses Compose navigation, Problem is there is a button on B screen to send email, so it needs to startActivity(context,intent), but I cannot get context, i tried all of these couldnt get it working, so is it possible that I can fire event from Compose screen B and startActivity is done by MainActivity? this context is making it so hard
Good content Philipp, one question, how do i handle if user click outside of the permission dialog, if the permission dismissed it treats as false and shouldShowRationale function told that no need to show rationale, obviously because the user neither deny nor accept the permission request. How should i implement that ? thank you
Hi Philipp, thank you for this video. I have a scenario, while my app in open state if user revoked the permission in device settings screen my app is getting crashed, the current process is being terminated and i can not restart app properly. cau you please guide me how to handle this
I am working on an app that uses Bluetooth Classic. The guide from google developers is imho not really helpfull. If you target sdk above 30 (S) you have to deal with permission checks everywhere. The github repo they refer to is written in Java, and the code snippets they offer give no solution regarding permission checks. Can you please comment on this?
Welcome to the wild world of Android. Try to find examples using Sourcegraph. This is the struggle on Android, its always been like this and official documentation has always been lacking. Thats why we appreciate Philip so much!
What if the user grants permissions in the settings and presses back several times? In this case, the user still can see a dialog to open settings even though he just granted permission. How to handle this use case?
Has anyone tried multiple permission with Location Background? For me, only works requesting permissions one by one. But when I want request all of them at once, no dialog pops up. on Android 13
Hello Philip, Thank you for the video. I have a question: What's the process for hiding permission buttons when permissions are granted, displaying an alternative UI, and automatically dismissing the dialog when returning from settings without requiring an external click to dismiss it?
amazing video about permissions. Philipp which smartphone do you recommend on middle segment (xiaomi or Samsung)? [for better performance through the years and many years usage]. If you answer, I will be so happy❤❤
Hi, thanks for the video. The code has an error. When you decline the second permission for the first time and then accept, the permanently declined dialog will appear anyway for the first permission. Just telling you this to fix the code and inform somehow the rest of the people. Thanks for the rest, great content.
This error lies in the multiplePermissionResultLauncher's logic in expression "perms[permission] == true". Replace it with: if(perms.keys.contains(permission)) { perms[permission] == true } else true Explanation: We have static array permissionsToRequest defined at start of MainActivity. Then look at the call of multiplePermissionResultLauncher with only one permission. We go there through all values in permissionsToRequest and check if the permission was granted. And there's a problem. When we get to the permission that wasn't asked (and it's not in the perms map), "perms[permission] == true" will always return false. This permission was granted earlier, so it's not in the visiblePermissionDialogQueue, and viewModel adds this permission to the queue. shouldShowRationale is false, and we get dialog "Permission is permanently declined"
Hi Philipp, when we Don't Allow the permission for first time, then OK dialog shows but after then if we give the permission then also Grant Permission Rationale shows.. is it right thing?
Starting to watch this now: but does this address the failure of the accomp. library where you can't know on the first request whether they have been perm denied?
Hi Phillip. Thank you for this video and for others. Can you tell me how can I check permission is granted or not. When permission is granted I won't show button and when it isn't granted it will be hide.
When I launch the multiplePermissionRequestLaucher, it repeatedly shows the permanent permission decline dialog. Do you know how I can resolve this? It works fine in the Android 10, but not in the Android 13.
I don't think there's a mutableStateStack, but there's a mutableStateList. Otherwise, you'd need to replace the whole stack instance in order to cause a recomposition
One of the best things about your videos is that you make mistakes and then fix it.. which shows everyone the kind of mistakes they can run into and see how to fix them. Thank your for your time and effort.
I appreciate that!
@@PhilippLackner yeah true
OMG, Phillip, you totally saved my project with this video. I had an issue with Bluetooth permissions for Android 12 OS. I thought, I tried everything, but your implementation of permission request totally worked in my case, thank you!
Glad it helped!
If you need the sequence, I've posted a solution (in Java) on stackoverflow stackoverflow.com/a/72433009/5372618
I hope this might help.
Oh god, I was waiting for it. Thanks Philipp
Hope you like it!
you are my saviour as i change from xml to jetpack compose in android development! continue on making this awesome videos
Hi Phillip, i really thank you for your contributions to the Android Dev community. I hope you will make some videos about MVVM + Clean Architecture + Modularization in the future. I think many people are interested in this topic.
His paid courses covered all.
I got a whole course on that on my website :) pl-coding.com/premium-courses
@@PhilippLackner thank you ^^
@@PhilippLackner ya we know but its too expensive for indian students
@@PhilippLackner could please make it on udemy, i dont have much money
Hi Philipp! Once again: Thank you! You make it so much easier to deal with complex issues, that it now seems almost fun to handle permissions 😄
The best youtube developer I know
Thank you🙌❤️
Ths is amazing, Even Google does not have proper example code to handle these crazy permissions !!
Great video, but there's one problem, if the user had permanently declined a permission, goes to the app settings via the dialog and selects "ask every time", when he navigates back the "permanently denied" dialog is still shown and if he dismisses it, he won't see the prompt for permission again.
+1
Another Awesome Video on Permissions! thank you Philip!
hello, can you make a RUclips Short about different remember and remember update state?
After learning how permissions are handled on iOS from your recent KMM Translator course, we on Android definitely have a much harder time implementing this!
That's true 😅
Top notch content and editting. Thanks man.
Thanks for sharing, Phillip. Nice content 👏
As always, this is a really good content!
I have a simple question: How do you deal with permissions that depend on different Android builds (e.g. Bluetooth permissions)? Do you create different arrays based on Android versions?
Philipp is gonna reach 100 000 subs within a month!
can you please make a bluetooth tutorial ...
THANK YOU SO MUCH!!! PLEASE HELP I have created single activity by watching your Clean MVVM Notes video, it uses Compose navigation, Problem is there is a button on B screen to send email, so it needs to startActivity(context,intent), but I cannot get context, i tried all of these couldnt get it working, so is it possible that I can fire event from Compose screen B and startActivity is done by MainActivity? this context is making it so hard
i think you need to use val activity = (LocalContext.current as ComponentActivity) then use that instance to launch an activity function
Good content Philipp, one question, how do i handle if user click outside of the permission dialog, if the permission dismissed it treats as false and shouldShowRationale function told that no need to show rationale, obviously because the user neither deny nor accept the permission request. How should i implement that ? thank you
As always, making incredible content!!!
Thank you very much, keep it up 😎
Thanks bro. I required to this nowadays 😃
Sir, can you do video topic using ffmepg , opencv, opengles in android
I would very apreciate it if you will make video about Alert Dialog
Hi Philipp, thank you for this video. I have a scenario, while my app in open state if user revoked the permission in device settings screen my app is getting crashed, the current process is being terminated and i can not restart app properly. cau you please guide me how to handle this
I am working on an app that uses Bluetooth Classic. The guide from google developers is imho not really helpfull. If you target sdk above 30 (S) you have to deal with permission checks everywhere. The github repo they refer to is written in Java, and the code snippets they offer give no solution regarding permission checks. Can you please comment on this?
Welcome to the wild world of Android. Try to find examples using Sourcegraph. This is the struggle on Android, its always been like this and official documentation has always been lacking. Thats why we appreciate Philip so much!
@@ChrisAthanas I do appreciate Philip!
Thank you Phillip!
What if the user grants permissions in the settings and presses back several times? In this case, the user still can see a dialog to open settings even though he just granted permission. How to handle this use case?
buttons line is not working to be deprecated for API 33. The project breaks after minute 11
Has anyone tried multiple permission with Location Background? For me, only works requesting permissions one by one. But when I want request all of them at once, no dialog pops up. on Android 13
Hello Philip,
Thank you for the video. I have a question: What's the process for hiding permission buttons when permissions are granted, displaying an alternative UI, and automatically dismissing the dialog when returning from settings without requiring an external click to dismiss it?
Are we expected to handle permanently declined permission with shared preferences to recognize if we have already requested a permission before?
Hi Philipp I see you are using Material instead of Material3 , is there any reason why AlertDialog has change and some functionality was removed?
Hi Philip, Please make a clean architecture video with multiple models. Thank you
amazing video about permissions. Philipp which smartphone do you recommend on middle segment (xiaomi or Samsung)? [for better performance through the years and many years usage]. If you answer, I will be so happy❤❤
Time to say bye to good old Dexter library
can u make video on gsoc organizations which i can contribute as begginer in android
Hey what is the color theme you use on your android studio? Really like the colors on your editor
That would be "Xcode - Dark"
Issue: In material alert dialogue it works fine but not working in material3 alert dialogue.
Yeah, I'm new at this. Did google change the alertdialog parameters to remove buttons, title, and text?
Hi, thanks for the video.
The code has an error. When you decline the second permission for the first time and then accept, the permanently declined dialog will appear anyway for the first permission.
Just telling you this to fix the code and inform somehow the rest of the people.
Thanks for the rest, great content.
This error lies in the multiplePermissionResultLauncher's logic in expression "perms[permission] == true". Replace it with:
if(perms.keys.contains(permission)) {
perms[permission] == true
} else true
Explanation:
We have static array permissionsToRequest defined at start of MainActivity. Then look at the call of multiplePermissionResultLauncher with only one permission. We go there through all values in permissionsToRequest and check if the permission was granted. And there's a problem. When we get to the permission that wasn't asked (and it's not in the perms map), "perms[permission] == true" will always return false. This permission was granted earlier, so it's not in the visiblePermissionDialogQueue, and viewModel adds this permission to the queue. shouldShowRationale is false, and we get dialog "Permission is permanently declined"
Hi Philipp, when we Don't Allow the permission for first time, then OK dialog shows but after then if we give the permission then also Grant Permission Rationale shows.. is it right thing?
Thank you, it's very interesting way.
outstanding❤❤❤
Is it possible to teach a tutorial about building a library and placing it in the maven repository?
he already has a video on making a Library, as for putting it in the maven repository, idk chief, you're gonna have to figure that one out on your own
Starting to watch this now: but does this address the failure of the accomp. library where you can't know on the first request whether they have been perm denied?
That's an android limitation which no library can bypass as I said in the video 😄
Hi Phillip. Thank you for this video and for others. Can you tell me how can I check permission is granted or not. When permission is granted I won't show button and when it isn't granted it will be hide.
val isGranted = ActivityCompat.checkSelfPermission(context, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED
exactly my question
@@PhilippLackner Million Thanks dear Philipp
@@PhilippLackner thank you very much.
When I launch the multiplePermissionRequestLaucher, it repeatedly shows the permanent permission decline dialog. Do you know how I can resolve this? It works fine in the Android 10, but not in the Android 13.
haver you ever figured this out? I'm stuck in the same scenario for some reason
Thanks, you save my job😅😅
Nice bro ✌️🤗
what's the advantage of this system over the accompanist permissions API?
it's not possible to differentiate the between the it's the first time requesting the permission vs the user doesn't want to be asked again use cases.
This is a quite interesting solution. Why don't you replace List with Stack. It implements all the concept you need to.
I don't think there's a mutableStateStack, but there's a mutableStateList. Otherwise, you'd need to replace the whole stack instance in order to cause a recomposition
thanks alot very useful
Indeed scalable
Awesome
Instead of using 3 classes and 1 interface can't we just use a sealed interface or sealed class. Isn't this over architectured ?
But the whole purpose of this is that you're able to extend it, which isn't possible with a sealed class
Thank you Philipp 🖖
675th...Thanks Philipp
That's complex
Hi Phillip. Thanks for this video ,🙏🙏🙏🙏🙏👏👏👏👏👏👏👏👏👏👏👏👏👏💪💪💪💪💪💪👏👏👏
Thank you, I also think that whole system of permissions is complicated and shouldn't exists on android developers shoulders :(
Hi Philipp! Once again: Thank you! You make it so much easier to deal with complex issues, that it now seems almost fun to handle permissions 😄