All Projects → NewtronLabs → EasyPermissions

NewtronLabs / EasyPermissions

Licence: other
Request permissions from anywhere as long as you have context.

Projects that are alternatives of or similar to EasyPermissions

Hobbit Core
A flask project generator.
Stars: ✭ 49 (+25.64%)
Mutual labels:  marshmallow
Marshmallow Jsonschema
JSON Schema Draft v7 (http://json-schema.org/) formatting with marshmallow
Stars: ✭ 172 (+341.03%)
Mutual labels:  marshmallow
EzPermission
Light and easy to use library for managing android runtime permissions
Stars: ✭ 32 (-17.95%)
Mutual labels:  android-permissions
Dynamorm
Python object & relation mapping library for Amazon's DynamoDB service
Stars: ✭ 72 (+84.62%)
Mutual labels:  marshmallow
Flama
🔥 Fire up your API with this flamethrower
Stars: ✭ 161 (+312.82%)
Mutual labels:  marshmallow
Marshmallow Jsonapi
JSON API 1.0 (https://jsonapi.org/) formatting with marshmallow
Stars: ✭ 203 (+420.51%)
Mutual labels:  marshmallow
Runtimepermission
Simpliest way to ask runtime permissions on Android, no need to extend class or override permissionResult method, choose your way : Kotlin / Coroutines / RxJava / Java7 / Java8
Stars: ✭ 860 (+2105.13%)
Mutual labels:  marshmallow
pixel-art-supplies
Wholesale Pixel-Art resources (for free!) …
Stars: ✭ 31 (-20.51%)
Mutual labels:  freeware
Aiohttp Apispec
Build and document REST APIs with aiohttp and apispec
Stars: ✭ 172 (+341.03%)
Mutual labels:  marshmallow
Instant-Face-Unlock
Xposed Module's InstantFaceUnlock Code
Stars: ✭ 23 (-41.03%)
Mutual labels:  marshmallow
Flask Restplus Server Example
Real-life RESTful server example on Flask-RESTplus
Stars: ✭ 1,240 (+3079.49%)
Mutual labels:  marshmallow
Apifairy
A minimalistic API framework built on top of Flask, Marshmallow and friends.
Stars: ✭ 141 (+261.54%)
Mutual labels:  marshmallow
Flasgger
Easy OpenAPI specs and Swagger UI for your Flask API
Stars: ✭ 2,825 (+7143.59%)
Mutual labels:  marshmallow
Webargs
A friendly library for parsing HTTP request arguments, with built-in support for popular web frameworks, including Flask, Django, Bottle, Tornado, Pyramid, webapp2, Falcon, and aiohttp.
Stars: ✭ 1,145 (+2835.9%)
Mutual labels:  marshmallow
marshmallow-validators
Use 3rd-party validators (e.g. from WTForms and colander) with marshmallow
Stars: ✭ 24 (-38.46%)
Mutual labels:  marshmallow
Python Api Development Fundamentals
Develop a full-stack web application with Python and Flask
Stars: ✭ 44 (+12.82%)
Mutual labels:  marshmallow
Django Rest Marshmallow
Marshmallow schemas for Django REST framework
Stars: ✭ 198 (+407.69%)
Mutual labels:  marshmallow
swagger-marshmallow-codegen
generating marshmallow's schema from swagger definition file
Stars: ✭ 51 (+30.77%)
Mutual labels:  marshmallow
djburger
Framework for safe and maintainable web-projects.
Stars: ✭ 75 (+92.31%)
Mutual labels:  marshmallow
MPContribs
Platform for materials scientists to contribute and disseminate their materials data through Materials Project
Stars: ✭ 30 (-23.08%)
Mutual labels:  marshmallow

Easy Permissions

Easy Permissions allows you to request all the permissions declared in your AndroidManifest with one line of code. It knows what permissions you have declared in your AndroidManifest and will request them for you if needed. In addition, it allows you to make this request from anywhere in your code; no longer will you have to request permissions exclusively from an Activity.

Easy Permissions


Sample - It knows what permissions you have in your AndroidManifest and will request them if needed.

EasyPermissions.getInstance().requestPermissions(IPermissionsListener(
        onCompleted = { grantedPermissions, deniedPermissions ->

        }
))

Table of Contents

  1. Information
  2. Setup
  3. Example 1
  4. Example 2
  5. Example 3
  6. Demo App
  7. Support Us
  8. License
  9. Contact

Information

Request permissions from anywhere. Make sure you implement IPermissionsListener to receive information about what is happening with your permission request.

Setup

Include the below dependencies in your build.gradle project.

buildscript {
    repositories {
        google()
        maven { url "https://newtronlabs.jfrog.io/artifactory/libs-release-local" }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.0.4'
        classpath 'com.newtronlabs.android:plugin:5.0.2'
    }
}

allprojects {
    repositories {
        google()
        maven { url "https://newtronlabs.jfrog.io/artifactory/libs-release-local" }
    }
}

subprojects {
    apply plugin: 'com.newtronlabs.android'
}

In the build.gradle for your app.

dependencies {
    compileOnly 'com.newtronlabs.easypermissions:easypermissions:5.0.3-alpha01'
}

Example 1

This example uses a Service to request the permission, something that cannot be done without EasyPermissions. It also automatically requests the permissions that you have enabled on your AndroidManifest.

Kotlin

class ExampleService : Service(), IPermissionsListener {
    override fun onCreate() {
        super.onCreate()

        // Will request all permissions from the Manifest automatically.
        EasyPermissions.getInstance().requestPermissions(this)
    }

    override fun onCompleted(grantedPermissions: Set<String>, deniedPermissions: Set<String>) {}

    override fun onFailure(throwable: Throwable) {}
}

Java

public class ExampleService extends Service implements IPermissionsListener {
    @Override
    public void onCreate() {
        super.onCreate();
        
        // Will request all permissions from the Manifest automatically.
        EasyPermissions.getInstance().requestPermissions(this);
    }

    @Override
    public void onCompleted(Set<String> grantedPermissions, Set<String> deniedPermissions) {}

    @Override
    public void onFailure(Throwable throwable) {}
}

Example 2

This example allows more flexibility so that you can decide which permissions you desire. Request as many permissions as you like. You may seperate them by commas or pass an array. Make sure that these permissions are declared in your AndroidManifest as well.

EasyPermissions.getInstance().requestPermissions(this,
       Manifest.permission.ACCESS_FINE_LOCATION,
       Manifest.permission.CAMERA,
       Manifest.permission.CALL_PHONE,
       Manifest.permission.WRITE_EXTERNAL_STORAGE);

Example 3

Get a set of granted permissions.

EasyPermissions.getInstance().getGrantedPermissions()

Always add the permission to your AndroidManifest.xml

As an Android requirement permissions must be included in the Manifest.

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

Demo App

More detailed exmaples can be found in this repo's samples folders: Demo app


Support Us

Please support the continued development of these libraries. We host and develop these libraries for free. Any support is deeply appriciated. Thank you!

Support us

BTC Address: 39JmAfnNhaEPKz5wjQjQQj4jcv9BM11NQb


License

https://gist.github.com/NewtronLabs/216f45db2339e0bc638e7c14a6af9cc8

Contact

[email protected]

Website

http://www.newtronlabs.com/

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].