I have a problem with permission permissions in Android

Up to 23 versions of the permission were indicated only in the manifest, after they became, as in iOS, also programmatically write in order for the person to confirm the permissions.

How easier and more convenient to make it work for both 23+ and 22? Well, everything is too complicated and the code is too big to simply include permissions, say, to write to a memory card.

Happy New Year!

  • it's easier to set targetApi to 22 and not bother. In fact, for 22, the manifest works, for the above, permissions requests during operation. It is necessary to combine. - pavel
  • @pavel I also wanted to suggest setting targetSdkVersion to 22 , but how then will this application work (without the permission request code) on a device with 23+? - Regent
  • It turns out that for 22 you need to write in the manifest as before, but for 23+ you still have to do it programmatically? It will take so much time for each resolution - Andro

2 answers 2

Use the library if you do not want to write a lot of the same code. There are a lot of different things for this, but I recommend PermissionsDispatcher

    As far as I remember, in the docks it is written that if the minimum api is lower than android 6.0, then when installed at 6.0 and higher, they will be asked to ask for it all at once during installation and you can not use runtime permissions