Android Permission Check Library

Additional

Language
Java
Version
v2.0.0 (Feb 10, 2017)
Created
Mar 26, 2016
Updated
Feb 10, 2017 (Retired)
Owner
Drilon Reçica (drilonreqica)
Contributor
Drilon Reçica (drilonreqica)
1
Activity
Badge
Generate
Download
Source code
APK file

Announcement

Add library dependency using maven:

<dependency>
  <groupId>com.reqica.drilon</groupId>
  <artifactId>android-permission-check-library</artifactId>
  <version>2.0.0</version>
  <type>pom</type>
</dependency>

Add library dependency using ivy:

<dependency org='com.reqica.drilon' name='android-permission-check-library' rev='2.0.0'>
  <artifact name='android-permission-check-library' ext='pom' ></artifact>
</dependency>

Usage

Initialize Class CheckPermission:

CheckPermission checkPermission = new CheckPermission(context);

If you want to check and ask for a Single permission, call:

checkPermission.checkOne(@NonNull final String permission, @Nullable final String dialogMessage)

The 1st parameter is the actual permission, and the 2nd one is an optional Dialog Message that you can show to the user as an extra dialog, for better explanation/reason of the permission asked.

If you want to check and ask for Multiple permissions at once, call:

checkPermission.checkMultiple(@NonNullfinalString[] permissions, @NullablefinalString dialogMessage)

The 1st parameter is the actual permission, and the 2nd one is an optional Dialog Message that you can show to the user as an extra dialog, for better explanation/reason of the permissions asked.

If you want to go to the settings screen and see which permission are Granted and which ones are not, call:

checkPermission.openPermissionsSettings(@NonNullString packageName) {

The parameter you need to give here is the actual root packageName of the app.