Тёмный

The ULTIMATE Permission Handling Guide (Showing rationale + Permanently Declined) 

Philipp Lackner
Подписаться 175 тыс.
Просмотров 43 тыс.
50% 1

In this video I'll show you how you can build a scalable permission handling system in Jetpack Compose for Android.
⭐ Get certificates for your future job
⭐ Save countless hours of time
⭐ 100% money back guarantee for 30 days
⭐ Become a professional Android developer now:
pl-coding.com/premium-courses...
💻 Let me be your mentor and become an industry-ready Android developer in 10 weeks:
pl-coding.com/drop-table-ment...
Subscribe to my FREE newsletter for regular Android, Kotlin & Architecture advice!
pl-coding.com/newsletter
Join this channel to get access to perks:
/ @philipplackner
Get the source code for this video here:
github.com/philipplackner/Per...
Join my Discord server:
/ discord
Regular programming advice on my Instagram page: / _philipplackner_
Checkout my GitHub: github.com/philipplackner
You like my free content? Here you can buy me a coffee:
www.buymeacoffee.com/philippl...

Опубликовано:

 

11 фев 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 91   
@taradesyafriben3446
@taradesyafriben3446 10 месяцев назад
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 😄
@flowzk921
@flowzk921 Год назад
Another Awesome Video on Permissions! thank you Philip!
@andrianbantero3462
@andrianbantero3462 26 дней назад
you are my saviour as i change from xml to jetpack compose in android development! continue on making this awesome videos
@asadullahilyas
@asadullahilyas Год назад
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.
@PhilippLackner
@PhilippLackner Год назад
I appreciate that!
@vignaanjunior382
@vignaanjunior382 2 месяца назад
@@PhilippLackner yeah true
@nymexe
@nymexe Год назад
Oh god, I was waiting for it. Thanks Philipp
@PhilippLackner
@PhilippLackner Год назад
Hope you like it!
@stanrichie5340
@stanrichie5340 Год назад
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!
@PhilippLackner
@PhilippLackner Год назад
Glad it helped!
@TheZukkino
@TheZukkino Год назад
If you need the sequence, I've posted a solution (in Java) on stackoverflow stackoverflow.com/a/72433009/5372618 I hope this might help.
@syedfaizanali8046
@syedfaizanali8046 Год назад
Top notch content and editting. Thanks man.
@OrlanDroyd
@OrlanDroyd Год назад
As always, making incredible content!!! Thank you very much, keep it up 😎
6 месяцев назад
Thanks for sharing, Phillip. Nice content 👏
@LoveOurLife19
@LoveOurLife19 Год назад
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.
@osisuper98
@osisuper98 Год назад
His paid courses covered all.
@PhilippLackner
@PhilippLackner Год назад
I got a whole course on that on my website :) pl-coding.com/premium-courses
@LoveOurLife19
@LoveOurLife19 Год назад
@@PhilippLackner thank you ^^
@jayprakashjaiswal8220
@jayprakashjaiswal8220 Год назад
@@PhilippLackner ya we know but its too expensive for indian students
@imamyusupbachtiar5461
@imamyusupbachtiar5461 Год назад
@@PhilippLackner could please make it on udemy, i dont have much money
@lindaporsius
@lindaporsius Год назад
Thank you Phillip!
@mesutemrecelenk5447
@mesutemrecelenk5447 Год назад
Thanks bro. I required to this nowadays 😃
@AndreaBonatti
@AndreaBonatti Год назад
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?
@bjugdbjk
@bjugdbjk Год назад
Ths is amazing, Even Google does not have proper example code to handle these crazy permissions !!
@DiabloZq
@DiabloZq Год назад
Thank you, it's very interesting way.
@luckydevil1601
@luckydevil1601 Год назад
Philipp is gonna reach 100 000 subs within a month!
@ChrisAthanas
@ChrisAthanas Год назад
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!
@PhilippLackner
@PhilippLackner Год назад
That's true 😅
@NeerajKumar-du4rm
@NeerajKumar-du4rm Год назад
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
@harwinderbenipal5332
@harwinderbenipal5332 10 месяцев назад
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?
@eunhaeonnie1767
@eunhaeonnie1767 Год назад
hello, can you make a RU-vid Short about different remember and remember update state?
@nastenkaoo
@nastenkaoo Год назад
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❤❤
@user-gu7ee8jp7b
@user-gu7ee8jp7b 8 месяцев назад
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
@VinayParmar-bt1du
@VinayParmar-bt1du Год назад
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?
@user-pg6fw5kj6v
@user-pg6fw5kj6v 8 месяцев назад
outstanding❤❤❤
@injent
@injent Год назад
The best youtube developer I know
@PhilippLackner
@PhilippLackner Год назад
Thank you🙌❤️
@ahmadab9666
@ahmadab9666 8 месяцев назад
thanks alot very useful
@patrickadutwum5480
@patrickadutwum5480 Год назад
Hi Philip, Please make a clean architecture video with multiple models. Thank you
@PSK005
@PSK005 Год назад
Nice bro ✌️🤗
@dewetvanrooyen8458
@dewetvanrooyen8458 2 месяца назад
Hi Philipp I see you are using Material instead of Material3 , is there any reason why AlertDialog has change and some functionality was removed?
@yusufjonaxmed4488
@yusufjonaxmed4488 3 месяца назад
I would very apreciate it if you will make video about Alert Dialog
@gauravkumar-bs3pf
@gauravkumar-bs3pf 7 месяцев назад
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.
@scotty3024
@scotty3024 Год назад
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.
@shivangimathur
@shivangimathur 2 месяца назад
+1
@Cultofcosmossubscriber
@Cultofcosmossubscriber Год назад
Awesome
@BunsenBurns
@BunsenBurns Год назад
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?
@PhilippLackner
@PhilippLackner Год назад
That's an android limitation which no library can bypass as I said in the video 😄
@vaibhavnimkar6252
@vaibhavnimkar6252 Год назад
can u make video on gsoc organizations which i can contribute as begginer in android
@Maxwork82
@Maxwork82 3 месяца назад
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?
@chauluu7527
@chauluu7527 Год назад
Sir, can you do video topic using ffmepg , opencv, opengles in android
@user-yx6jn8bz8y
@user-yx6jn8bz8y Месяц назад
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
@03_amartoge4
@03_amartoge4 Год назад
can you please make a bluetooth tutorial ...
@parth3075
@parth3075 7 месяцев назад
Hey what is the color theme you use on your android studio? Really like the colors on your editor
@xCrawfly
@xCrawfly 2 месяца назад
That would be "Xcode - Dark"
@proandroiddevir
@proandroiddevir Год назад
Is it possible to teach a tutorial about building a library and placing it in the maven repository?
@maskedredstonerproz
@maskedredstonerproz Год назад
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
@imamyusupbachtiar5461
@imamyusupbachtiar5461 Год назад
Thanks, you save my job😅😅
@lindaporsius
@lindaporsius Год назад
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?
@ChrisAthanas
@ChrisAthanas Год назад
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!
@lindaporsius
@lindaporsius Год назад
@@ChrisAthanas I do appreciate Philip!
@xandrviking1113
@xandrviking1113 7 месяцев назад
Thank you Philipp 🖖
@norayrmovsisyan
@norayrmovsisyan Год назад
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.
@PhilippLackner
@PhilippLackner Год назад
val isGranted = ActivityCompat.checkSelfPermission(context, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED
@mehrtashsouri6862
@mehrtashsouri6862 Год назад
exactly my question
@mehrtashsouri6862
@mehrtashsouri6862 Год назад
@@PhilippLackner Million Thanks dear Philipp
@norayrmovsisyan
@norayrmovsisyan Год назад
@@PhilippLackner thank you very much.
@hugovera-sr3kr
@hugovera-sr3kr 28 дней назад
buttons line is not working to be deprecated for API 33. The project breaks after minute 11
@osisuper98
@osisuper98 Год назад
Indeed scalable
@syedfaizanali8046
@syedfaizanali8046 Год назад
Time to say bye to good old Dexter library
@kyleangelogonzales3989
@kyleangelogonzales3989 Год назад
what's the advantage of this system over the accompanist permissions API?
@kriisEU
@kriisEU Год назад
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.
@antoniofernandez160
@antoniofernandez160 Год назад
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.
@user-eu3rg9ce7v
@user-eu3rg9ce7v Год назад
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"
@TheZukkino
@TheZukkino Год назад
This is a quite interesting solution. Why don't you replace List with Stack. It implements all the concept you need to.
@PhilippLackner
@PhilippLackner Год назад
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
@prabaharanrajendran2455
@prabaharanrajendran2455 11 месяцев назад
Issue: In material alert dialogue it works fine but not working in material3 alert dialogue.
@john.mattock
@john.mattock 5 месяцев назад
Yeah, I'm new at this. Did google change the alertdialog parameters to remove buttons, title, and text?
@mymobile550
@mymobile550 Год назад
Instead of using 3 classes and 1 interface can't we just use a sealed interface or sealed class. Isn't this over architectured ?
@PhilippLackner
@PhilippLackner Год назад
But the whole purpose of this is that you're able to extend it, which isn't possible with a sealed class
@jopadjr
@jopadjr 9 месяцев назад
675th...Thanks Philipp
@sumit180288
@sumit180288 Год назад
That's complex
@proandroiddevir
@proandroiddevir Год назад
Hi Phillip. Thanks for this video ,🙏🙏🙏🙏🙏👏👏👏👏👏👏👏👏👏👏👏👏👏💪💪💪💪💪💪👏👏👏
@1mYse1LF
@1mYse1LF Год назад
Thank you, I also think that whole system of permissions is complicated and shouldn't exists on android developers shoulders :(
@lindaporsius
@lindaporsius Год назад
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 😄
Далее
Node.js is a serious thing now… (2023)
8:18
Просмотров 634 тыс.
How To Properly Handle Permissions in Android
21:36
Просмотров 1 тыс.
You might not need useEffect() ...
21:45
Просмотров 154 тыс.