All Projects → TheSomeshKumar → PermissionMadeEasy

TheSomeshKumar / PermissionMadeEasy

Licence: MIT License
Android Library for Easily calling Runtime Permission on Android Marshmallow and above

Programming Languages

kotlin
9241 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to PermissionMadeEasy

Simplify-Permissions
Android library to simplifies the android permission request at runtime.
Stars: ✭ 22 (+46.67%)
Mutual labels:  android-permissions
RiskInDroid
A tool for quantitative risk analysis of Android applications based on machine learning techniques
Stars: ✭ 69 (+360%)
Mutual labels:  android-permissions
startask-permissions
Is a library that helps to handle runtime permissions on Android, entirely written using Kotlin language.
Stars: ✭ 39 (+160%)
Mutual labels:  android-permissions
sentry
A lightweight (23KB) wrapper for inline Android permission checks/requests.
Stars: ✭ 22 (+46.67%)
Mutual labels:  android-permissions
EasyPermissions
Request permissions from anywhere as long as you have context.
Stars: ✭ 39 (+160%)
Mutual labels:  android-permissions
EzPermission
Light and easy to use library for managing android runtime permissions
Stars: ✭ 32 (+113.33%)
Mutual labels:  android-permissions
Rxpermissions
Android runtime permissions powered by RxJava2
Stars: ✭ 10,288 (+68486.67%)
Mutual labels:  android-permissions

Android Arsenal Release

Note: Deprecated as the new way of requesting permission is quite straightforward

PermissionMadeEasy

Android Library for Easily calling Runtime Permission on Android Marshmallow and above

How to build

Add Jitpack.io to your project level build.gradle file

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

Add the dependency

dependencies {
	  implementation 'com.github.thesomeshkumar:permissionmadeeasy:1.2.3'
	}

How to use

Create a PermissionHelper object

permissionHelper = PermissionHelper.Builder()
        .with(this)
        .requestCode(REQUEST_CODE_MULTIPLE)
        .setPermissionResultCallback(this)
        .askFor(Permission.CALENDAR, Permission.CAMERA, Permission.CONTACTS,
                Permission.LOCATION, Permission.MICROPHONE, Permission.STORAGE,
                Permission.PHONE, Permission.SMS, Permission.SENSORS)
        .rationalMessage("Permissions are required for app to work properly")
        .build()

and when you want to ask for the permission just call

permissionHelper.requestPermissions()

Override onPermissionsGranted and onPermissionsDenied functions

Also override onRequestPermissionsResult and pass the arguments recieved to PermissionHelper class' onRequestPermissionsResult function.

@Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
        permissionHelper.onRequestPermissionsResult(requestCode, permissions, grantResults);
    }

Detailed full sample project is included. Check DemoActivity for full implemetation

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].