What permissions need to be requested at run time?

0
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />

These are my permissions, I am in doubt whether I need to notify the user to allow it or not, I was seeing that from API 23 we need to do this If I need to, how do I do this?

    
asked by anonymous 16.10.2018 / 22:24

2 answers

0

Permissions that need to be requested at run time are those that are considered "dangerous" #.

Within the list you provided, READ_CALENDAR and WRITE_CALENDAR are in the "dangerous" group.

See this response for how to deal with them.

    
16.10.2018 / 22:39
0

Here is the code to request permissions from version 23:

String [] permissions = {"android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.ACCESS_FINE_LOCATION","android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.READ_PHONE_STATE", "android.permission.SYSTEM_ALERT_WINDOW","android.permission.CAMERA"};
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
    int requestCode = 200;
    requestPermissions(permissions, requestCode);
}

In the variable permissions I put some random permissions, change and put the ones that you need

    
16.10.2018 / 22:38