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

Поделиться
HTML-код
  • Опубликовано: 17 дек 2024

Комментарии • 95

  • @asadullahilyas
    @asadullahilyas Год назад +11

    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.

  • @stanrichie5340
    @stanrichie5340 Год назад +5

    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.

  • @nymexe
    @nymexe Год назад +4

    Oh god, I was waiting for it. Thanks Philipp

  • @andrianbantero3462
    @andrianbantero3462 5 месяцев назад

    you are my saviour as i change from xml to jetpack compose in android development! continue on making this awesome videos

  • @LoveOurLife19
    @LoveOurLife19 Год назад +20

    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 Год назад +4

      His paid courses covered all.

    • @PhilippLackner
      @PhilippLackner  Год назад +7

      I got a whole course on that on my website :) pl-coding.com/premium-courses

    • @LoveOurLife19
      @LoveOurLife19 Год назад +1

      @@PhilippLackner thank you ^^

    • @Jaylight977
      @Jaylight977 Год назад +2

      @@PhilippLackner ya we know but its too expensive for indian students

    • @imamyusupbachtiar5461
      @imamyusupbachtiar5461 Год назад +2

      @@PhilippLackner could please make it on udemy, i dont have much money

  • @lindaporsius
    @lindaporsius Год назад +1

    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 😄

  • @injent
    @injent Год назад +1

    The best youtube developer I know

  • @bjugdbjk
    @bjugdbjk Год назад +1

    Ths is amazing, Even Google does not have proper example code to handle these crazy permissions !!

  • @scotty3024
    @scotty3024 Год назад +11

    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.

  • @flowzk921
    @flowzk921 Год назад

    Another Awesome Video on Permissions! thank you Philip!

  • @eunhaeonnie1767
    @eunhaeonnie1767 Год назад +2

    hello, can you make a RUclips Short about different remember and remember update state?

  • @ChrisAthanas
    @ChrisAthanas Год назад +2

    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!

  • @syedfaizanali8046
    @syedfaizanali8046 Год назад

    Top notch content and editting. Thanks man.

  •  11 месяцев назад

    Thanks for sharing, Phillip. Nice content 👏

  • @AndreaBonatti
    @AndreaBonatti Год назад +4

    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?

  • @luckydevil1601
    @luckydevil1601 Год назад

    Philipp is gonna reach 100 000 subs within a month!

  • @03_amartoge4
    @03_amartoge4 Год назад +3

    can you please make a bluetooth tutorial ...

  • @NeerajKumar-du4rm
    @NeerajKumar-du4rm Год назад +1

    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

    • @meidy3795
      @meidy3795 2 месяца назад

      i think you need to use val activity = (LocalContext.current as ComponentActivity) then use that instance to launch an activity function

  • @meidy3795
    @meidy3795 2 месяца назад

    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

  • @OrlanDroyd
    @OrlanDroyd Год назад

    As always, making incredible content!!!
    Thank you very much, keep it up 😎

  • @mesutemrecelenk5447
    @mesutemrecelenk5447 Год назад

    Thanks bro. I required to this nowadays 😃

  • @chauluu7527
    @chauluu7527 Год назад +1

    Sir, can you do video topic using ffmepg , opencv, opengles in android

  • @yusufjonaxmed4488
    @yusufjonaxmed4488 8 месяцев назад

    I would very apreciate it if you will make video about Alert Dialog

  • @SunilKumarPanthangi
    @SunilKumarPanthangi Год назад

    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

  • @lindaporsius
    @lindaporsius Год назад +1

    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 Год назад +3

      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!

  • @lindaporsius
    @lindaporsius Год назад

    Thank you Phillip!

  • @Maxwork82
    @Maxwork82 8 месяцев назад

    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?

  • @hugovera-sr3kr
    @hugovera-sr3kr 5 месяцев назад

    buttons line is not working to be deprecated for API 33. The project breaks after minute 11

  • @JaimeHernandez-i8y
    @JaimeHernandez-i8y 6 месяцев назад

    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

  • @harwinderbenipal5332
    @harwinderbenipal5332 Год назад

    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?

  • @jgaurav6
    @jgaurav6 4 месяца назад

    Are we expected to handle permanently declined permission with shared preferences to recognize if we have already requested a permission before?

  • @dewetvanrooyen8458
    @dewetvanrooyen8458 7 месяцев назад

    Hi Philipp I see you are using Material instead of Material3 , is there any reason why AlertDialog has change and some functionality was removed?

  • @patrickadutwum5480
    @patrickadutwum5480 Год назад

    Hi Philip, Please make a clean architecture video with multiple models. Thank you

  • @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❤❤

  • @syedfaizanali8046
    @syedfaizanali8046 Год назад +1

    Time to say bye to good old Dexter library

  • @vaibhavnimkar6252
    @vaibhavnimkar6252 Год назад

    can u make video on gsoc organizations which i can contribute as begginer in android

  • @parth3075
    @parth3075 Год назад

    Hey what is the color theme you use on your android studio? Really like the colors on your editor

    • @xCrawfly
      @xCrawfly 7 месяцев назад +1

      That would be "Xcode - Dark"

  • @prabaharanrajendran2455
    @prabaharanrajendran2455 Год назад +1

    Issue: In material alert dialogue it works fine but not working in material3 alert dialogue.

    • @john.mattock
      @john.mattock 10 месяцев назад

      Yeah, I'm new at this. Did google change the alertdialog parameters to remove buttons, title, and text?

  • @antoniofernandez160
    @antoniofernandez160 Год назад +3

    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.

    • @ЕвгенийПавлусенко
      @ЕвгенийПавлусенко Год назад +9

      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"

  • @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?

  • @DiabloZq
    @DiabloZq Год назад

    Thank you, it's very interesting way.

  • @MegaMindsStudio
    @MegaMindsStudio Год назад

    outstanding❤❤❤

  • @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

  • @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 😄

  • @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  Год назад +2

      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.

  • @gauravkumar-bs3pf
    @gauravkumar-bs3pf Год назад

    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.

    • @vincentschauer
      @vincentschauer 2 месяца назад

      haver you ever figured this out? I'm stuck in the same scenario for some reason

  • @imamyusupbachtiar5461
    @imamyusupbachtiar5461 Год назад

    Thanks, you save my job😅😅

  • @PSK005
    @PSK005 Год назад

    Nice bro ✌️🤗

  • @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.

  • @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

  • @ahmadab9666
    @ahmadab9666 Год назад

    thanks alot very useful

  • @osisuper98
    @osisuper98 Год назад

    Indeed scalable

  • @Cultofcosmossubscriber
    @Cultofcosmossubscriber Год назад +1

    Awesome

  • @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  Год назад +1

      But the whole purpose of this is that you're able to extend it, which isn't possible with a sealed class

  • @xandrviking1113
    @xandrviking1113 11 месяцев назад

    Thank you Philipp 🖖

  • @jopadjr
    @jopadjr Год назад

    675th...Thanks Philipp

  • @sumit180288
    @sumit180288 Год назад +2

    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 :(

  • @taradesyafriben3446
    @taradesyafriben3446 Год назад +4

    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 😄