简体   繁体   中英

Android permissions: asking options guide

I apologize in advance for my language and if this thread is a duplicate.

I would like to ask for a 'mini-guide' on android permission asking for 6.0+. The problem that I am personally having is some applications I recently released require permissions like internet and external storage . But the only way I could 'help' the user from going manually to settings -> app settings etc, is launching an intent on button press for the app setting page.

So what I am asking is: For newest versions of Android (assuming it will work on most older versions too), is there a way to:

  1. Ask for every permission you need to be accepted before downloading on Play Store and then enabled by default?
  2. Ask on first time app launch to give permanent permissions to app and on positive response, programmatically enable them?
  3. Ask the user for a one-time, dynamic, TEMPORARY, permission request. For example, app1 does not have permission to write to an external storage. On button1 press, ask temporary permission to write to a file in the external storage. If the user clicks button1 again, permission will be asked again.

Again, apologies if this question has been asked before. I want to assure you I did a lot of research, and most of the answers I found didn't seem to work...

Thanks

1) I think its not possible to enable all permissions by default since its a major update in Android 6+ devices to enable users to control runtime permissions the app needed.

For 2 & 3)

For my project I have written a static java class to request android runtime permissions. You can use that if you want. You have to add other permissions as you need in the same pattern as described in the class.

I have provided the Github link below

Github

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM