Skip to content

This is an Android Library that provides a feature for the developer to handle permission in android

Notifications You must be signed in to change notification settings

Pisey-Nguon/PermissionHandler

Repository files navigation

Welcome to PermissionHandler!

Hi! This is an Android Library that provides a feature for the developer to handle permission in android so please take a look at the instructions below, Thank!

How to

To get a Git project into your build:

Step 1. Add the JitPack repository to your build file

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

Step 2. Add the dependency

	dependencies {
	        implementation 'com.github.Pisey-Nguon:PermissionHandler:TAG'
	}

Note: TAG is a version of the package so please change it based here

Step 3. Implementation

    private var permissionHandler = PermissionHandler(this)
         permissionHandler.runMultiplePermission(
            android.Manifest.permission.ACCESS_FINE_LOCATION,
            android.Manifest.permission.ACCESS_COARSE_LOCATION,
        ){
            Log.d(TAG, "runMultiplePermission: Permissions allowed")
            Toast.makeText(this, "Location Permission allowed", Toast.LENGTH_LONG).show()
        }
	
	permissionHandler.runSinglePermission(android.Manifest.permission.CAMERA){
            Log.d(TAG, "runMultiplePermission: Permission allowed")
            Toast.makeText(this, "Camera Permission allowed", Toast.LENGTH_LONG).show()
        }

UML diagrams

This is a behavior of PermissionHandler

enter image description here

About

This is an Android Library that provides a feature for the developer to handle permission in android

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages