Skip to content

henrychuangtw/AndroidRuntimePermission

Repository files navigation

RuntimePermission

Android RuntimePermission, example of Dangerous Permissions and Special Permissions

In my practical experience, I think it is better to use common activity to request permission, advantage of this design pattern :

  1. No need to add RuntimePermission code in every activity or fragment.
  2. If RuntimePermission code need to edit later, just edit common activity.
  3. Avoiding bugs with nested fragment(ex: Issue 189121).



Dangerous Permissions(Ex: in activity or fragment) and Special Permissions(Ex: setRingtone)


permission dialog


show UI with rationale of requesting this permission


once user deny permission, next time will see "Nerver ask again"


open your app setting when user chose "Nerver ask again"


request multiple permissions


use common activity to request permission

Test Device

HTC One A9, Android 6.0
HTC One X, Android 4.2.2

Reference

http://inthecheesefactory.com/blog/things-you-need-to-know-about-android-m-permission-developer-edition/en
http://stackoverflow.com/questions/30719047/android-m-check-runtime-permission-how-to-determine-if-the-user-checked-nev
https://developer.android.com/training/permissions/index.html
https://developer.android.com/guide/topics/security/permissions.html#normal-dangerous

About

Android RuntimePermission Example, open app setting when user chose "Never ask again"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages