All Projects → mukeshsolanki → Easypermissions Android

mukeshsolanki / Easypermissions Android

Licence: mit
A simple library that will remove all the boilerplate code and speed up your work with new Runtime Permissions introduced in Android M.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Easypermissions Android

Spring Backend Boilerplate
The modularized backend boilerplate based on Spring Boot Framework, easy to get started and add your business part.
Stars: ✭ 134 (+57.65%)
Mutual labels:  gradle, boilerplate
Gradle Buildconfig Plugin
A plugin for generating BuildConstants for any kind of Gradle projects: Java, Kotlin, Groovy, etc. Designed for KTS scripts.
Stars: ✭ 85 (+0%)
Mutual labels:  gradle
Hidden Secrets Gradle Plugin
🔒 Deeply hide secrets on Android
Stars: ✭ 79 (-7.06%)
Mutual labels:  gradle
Reactjs Crud Boilerplate
Live Demo
Stars: ✭ 83 (-2.35%)
Mutual labels:  boilerplate
Pwa Boilerplate
✨ PWA Boilerplate is highly scalable and is designed to help you kick-start your next project 🔭.
Stars: ✭ 82 (-3.53%)
Mutual labels:  boilerplate
Project
⭐️ Antares Project Application Skeleton. This is the very first place you should start. It allows you to create a brand new awesome project in easy few steps.
Stars: ✭ 84 (-1.18%)
Mutual labels:  boilerplate
React Starter
🚀 A minimal react boilerplate featuring easy-peasy state management and styled-components
Stars: ✭ 79 (-7.06%)
Mutual labels:  boilerplate
The Ultimate Boilerplate
webpack 2, react hotloader 3, react router v4, code splitting and more
Stars: ✭ 85 (+0%)
Mutual labels:  boilerplate
Angular Full Stack
Angular Full Stack project built using Angular, Express, Mongoose and Node. Whole stack in TypeScript.
Stars: ✭ 1,261 (+1383.53%)
Mutual labels:  boilerplate
Hex Arch Kotlin Spring Boot
Reference JVM multi module project for a reactive micro service and lambda using a hexagonal architecture, DDD, Kotlin, Spring Boot, Quarkus, Lambda, Gradle.
Stars: ✭ 83 (-2.35%)
Mutual labels:  gradle
Node Developer Boilerplate
🍭 Boilerplate for ES6+ Node.js and npm Developer
Stars: ✭ 82 (-3.53%)
Mutual labels:  boilerplate
Circleci Orbs
The source code for some of the orbs published by CircleCI
Stars: ✭ 82 (-3.53%)
Mutual labels:  gradle
Gradle Plugins
Gradle Plugin Collection
Stars: ✭ 84 (-1.18%)
Mutual labels:  gradle
Fivem Rp Boilerplate
🔫 Boilerplate for FiveM Roleplay servers. Save time and focus on your real project.
Stars: ✭ 81 (-4.71%)
Mutual labels:  boilerplate
Preact Redux Isomorphic
preact-redux-isomorphic PWA SPA SSR best practices and libraries in under 80kB page size (for live demo click the link below)
Stars: ✭ 85 (+0%)
Mutual labels:  boilerplate
Node Express Mongoose
A boilerplate application for building web apps using node and mongodb
Stars: ✭ 1,221 (+1336.47%)
Mutual labels:  boilerplate
React Webpack Babel
Simple React Webpack Babel Starter Kit
Stars: ✭ 1,241 (+1360%)
Mutual labels:  boilerplate
React Express Webpack
React boilerplate with ES2015, Express.js, and Webpack 4
Stars: ✭ 84 (-1.18%)
Mutual labels:  boilerplate
Blazorboilerplate
Blazor Boilerplate / Starter Template with MatBlazor
Stars: ✭ 1,258 (+1380%)
Mutual labels:  boilerplate
React Ssr Boilerplate
A boilerplate for server-side rendered React Applications. Includes local auth and GitHub Oauth 2 strategies.
Stars: ✭ 85 (+0%)
Mutual labels:  boilerplate

Runtime Permission Library(Android)



A simple library that will remove all the boilerplate code and speed up your work with new Runtime Permissions introduced in Android M.

Supporting Android Easy Permissions

Android Easy Permissions is an independent project with ongoing development and support made possible thanks to donations made by these awesome backers. If you'd like to join them, please consider:

What are Runtime Permissions?

Google docs is here. Unlike the traditional way of asking permission Android M increased its security by enforcing apps to ask permissions on the fly as and when the user requests for a feature that requires those permissions. These permissions can also be revoked by the user at any time.

How to integrate into your app?

Integrating the library into you app is extremely easy. A few changes in the build gradle and your all ready to user Runtime permissions library. Make the following changes to build.gradle inside you app.

Step 1. Add the JitPack repository to your build file. Add it in your root build.gradle at the end of repositories:

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

Step 2. Add the dependency

dependencies {
        implementation 'com.github.mukeshsolanki:easypermissions-android:<latest-version>'
}

How to use the library?

Okay seems like you integrated the library in your project but how do you use it? Well its really easy just follow the steps below.

 EasyPermissions easyPermissions =  new EasyPermissions.Builder()
                                           .with(this) //Activity
                                           .listener(
                                               new OnPermissionListener() {
                                                 @Override public void onAllPermissionsGranted(@NonNull List<String> permissions) {
                                                    // Triggered if all permissions were given
                                                 }

                                                 @Override public void onPermissionsGranted(@NonNull List<String> permissions) {
                                                    // Lists all the permissions that were granted
                                                 }

                                                 @Override public void onPermissionsDenied(@NonNull List<String> permissions) {
                                                    // Lists all the permissions that were denied
                                                 }
                                               })
                                           .build();

Dont forget to override the onRequestPermissionsResult and pass teh result to the library like wise

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

Check Permissions

To check if the app already has permissions use

  • easyPermissions.hasPermission(String Permissions) - To check one permission at a time
  • easyPermissions.hasPermission(String[] Permissions) - To check multiple permissions at the same time

Request Permissions

  • easyPermissions.request(String permission) - To request one permission at a time
  • easyPermissions.request(String[] permission) - To request multiple permissions at the same time.

That's pretty much it and your all wrapped up.

Author

Maintained by Mukesh Solanki

Contribution

GitHub contributors

License

Copyright (c) 2018 Mukesh Solanki

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
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].