Get permissions at installing time

954 Views Asked by At

I want to get permissions at install time in my Android application. For this reason, I had to downgrade the targetsdk from 27 to 22. Currently, my build.gradle information is as follows:

minSDK 17 
targetSdkVersion 22
compileSdkVersion 27
buildToolsVersion '27.0.0'

and in my application, these libraries have been used:

compile 'com.android.support:appcompat-v7:27.0.1'
compile 'com.android.support:design:27.0.1'
compile 'com.android.support:support-v4:27.0.1'
compile 'com.android.support:recyclerview-v7:27.0.1'

The problem is that it is not installed on my Android 8.1 (Pixel phone), but on other phones there is no problem with the lower Android versions.

1

There are 1 best solutions below

4
On

You can't request permission at install time, this is outdated, because it was used like in 5.x and less versions of Android, now you need to request permissions inside the app

the user grants the permission either when they install the app (on Android 5.1.1 and lower) or while running the app (on Android 6.0 and higher).

https://developer.android.com/training/permissions/declaring.html