Simplify Android M system permissions

Overview

EasyPermissions Build Status Code Coverage Android Weekly

EasyPermissions is a wrapper library to simplify basic system permissions logic when targeting Android M or higher.

Note: If your app is written in Kotlin consider the easypermissions-ktx library which adds Kotlin extensions to the core EasyPermissions library.

Installation

EasyPermissions is installed by adding the following dependency to your build.gradle file:

dependencies {
    // For developers using AndroidX in their applications
    implementation 'pub.devrel:easypermissions:3.0.0'
 
    // For developers using the Android Support Library
    implementation 'pub.devrel:easypermissions:2.0.1'
}

Usage

Basic

To begin using EasyPermissions, have your Activity (or Fragment) override the onRequestPermissionsResult method:

public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

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

        // Forward results to EasyPermissions
        EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this);
    }
}

Request Permissions

The example below shows how to request permissions for a method that requires both CAMERA and ACCESS_FINE_LOCATION permissions. There are a few things to note:

  • Using EasyPermissions#hasPermissions(...) to check if the app already has the required permissions. This method can take any number of permissions as its final argument.
  • Requesting permissions with EasyPermissions#requestPermissions. This method will request the system permissions and show the rationale string provided if necessary. The request code provided should be unique to this request, and the method can take any number of permissions as its final argument.
  • Use of the AfterPermissionGranted annotation. This is optional, but provided for convenience. If all of the permissions in a given request are granted, all methods annotated with the proper request code will be executed(be sure to have an unique request code). The annotated method needs to be void and without input parameters (instead, you can use onSaveInstanceState in order to keep the state of your suppressed parameters). This is to simplify the common flow of needing to run the requesting method after all of its permissions have been granted. This can also be achieved by adding logic on the onPermissionsGranted callback.
@AfterPermissionGranted(RC_CAMERA_AND_LOCATION)
private void methodRequiresTwoPermission() {
    String[] perms = {Manifest.permission.CAMERA, Manifest.permission.ACCESS_FINE_LOCATION};
    if (EasyPermissions.hasPermissions(this, perms)) {
        // Already have permission, do the thing
        // ...
    } else {
        // Do not have permissions, request them now
        EasyPermissions.requestPermissions(this, getString(R.string.camera_and_location_rationale),
                RC_CAMERA_AND_LOCATION, perms);
    }
}

Or for finer control over the rationale dialog, use a PermissionRequest:

EasyPermissions.requestPermissions(
        new PermissionRequest.Builder(this, RC_CAMERA_AND_LOCATION, perms)
                .setRationale(R.string.camera_and_location_rationale)
                .setPositiveButtonText(R.string.rationale_ask_ok)
                .setNegativeButtonText(R.string.rationale_ask_cancel)
                .setTheme(R.style.my_fancy_style)
                .build());

Optionally, for a finer control, you can have your Activity / Fragment implement the PermissionCallbacks interface.

public class MainActivity extends AppCompatActivity implements EasyPermissions.PermissionCallbacks {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

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

        // Forward results to EasyPermissions
        EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this);
    }

    @Override
    public void onPermissionsGranted(int requestCode, List<String> list) {
        // Some permissions have been granted
        // ...
    }

    @Override
    public void onPermissionsDenied(int requestCode, List<String> list) {
        // Some permissions have been denied
        // ...
    }
}

Required Permissions

In some cases your app will not function properly without certain permissions. If the user denies these permissions with the "Never Ask Again" option, you will be unable to request these permissions from the user and they must be changed in app settings. You can use the method EasyPermissions.somePermissionPermanentlyDenied(...) to display a dialog to the user in this situation and direct them to the system setting screen for your app:

Note: Due to a limitation in the information provided by the Android framework permissions API, the somePermissionPermanentlyDenied method only works after the permission has been denied and your app has received the onPermissionsDenied callback. Otherwise the library cannot distinguish permanent denial from the "not yet denied" case.

@Override
public void onPermissionsDenied(int requestCode, List<String> perms) {
    Log.d(TAG, "onPermissionsDenied:" + requestCode + ":" + perms.size());

    // (Optional) Check whether the user denied any permissions and checked "NEVER ASK AGAIN."
    // This will display a dialog directing them to enable the permission in app settings.
    if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) {
        new AppSettingsDialog.Builder(this).build().show();
    }
}

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == AppSettingsDialog.DEFAULT_SETTINGS_REQ_CODE) {
        // Do something after user returned from app settings screen, like showing a Toast.
        Toast.makeText(this, R.string.returned_from_app_settings_to_activity, Toast.LENGTH_SHORT)
                .show();
    }
}

Interacting with the rationale dialog

Implement the EasyPermissions.RationaleCallbacks if you want to interact with the rationale dialog.

@Override
public void onRationaleAccepted(int requestCode) {
    // Rationale accepted to request some permissions
    // ...
}

@Override
public void onRationaleDenied(int requestCode) {
    // Rationale denied to request some permissions
    // ...
}

Rationale callbacks don't necessarily imply permission changes. To check for those, see the EasyPermissions.PermissionCallbacks.

LICENSE

	Copyright 2017 Google

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

Comments
  • Migrate project to Kotlin

    Migrate project to Kotlin

    logo

    Description

    Migrate all entire project to Kotlin 1.3.50, but keeping the integration concept. These are some of the things that have been done:

    • Migrate entire sample to kotlin
    • Make the library more modular by structure better the files / code
    • Add a project logo, make more easy to identify it (It is just a proposal 😄 , please share you point of view)
    • Add severals tools like ktlint, detekt, spotless for static analysis code adding them to Travis
    • Migrate all the tests to kotlin, for guaranty the coverage for new code
    • Modify readme specify the minim API version, and increase the version to 3.1.0 (please review this part if you consider to make major change)
    • Simplify logic about Rationale/Settings dialogs displaying an AlertDialog
    • Eradicate LowAPiPermissions for avoid throw exception to integrator on their code

    Overview

    • Architecture:
    Screenshot 2019-09-06 at 11 49 22
    • Coverage:
    Screenshot 2019-09-06 at 17 10 43

    Next Steps

    Obviously with these changes, we only migrate the project to kotlin with little changes or simplifications. It's a good point to continue in this line and try to simplify the integration of the library and not only also adding more coverage tests, code documentation, etc..

    opened by vmadalin 15
  • Crash when deny permission #184

    Crash when deny permission #184

    My English is poor, this paper is from youdao translation,I hope you can understand.

    Basic Information

    Device type: MI 5 OS version: 7.0 EasyPermissions version: 1.1.1

    Describe the problem

    The situation is the same as #184

    Code and logs

    image image

    I don't seem to have the wrong information image

    If you request permissions like this, the software does not crash

    image There is no need to limit compileSdkVersion or targetSdkVersion or buildToolsVersion or support libs verion

    Idea

    Hope EasyPermissions, Can be integrated This method,Only request not get permissions.

    bug 
    opened by guominfang 15
  • Created a test for permissionPermanentlyDenied

    Created a test for permissionPermanentlyDenied

    The method call requires an activity, so I've added that (and an Application class which it requires and test configuration which that requires)

    The test is failing.

    The test is correct. The underlying library method does not work correctly.

    opened by itsymbal 13
  • Problem with stack rationale dialog

    Problem with stack rationale dialog

    Basic Information

    Device type: ________ OS version: ________ EasyPermissions version: 1.0.1

    Describe the problem

    What happened? What did you expect to happen?

    When I executed code below code 0 in onStart() every time show new rationale dialog over previous dialog. If dialog is exist new dialog should'nt show. A good solution would be to add a method that checks whether or not a rationale dialog is shown code 1 and code 2

    Code and logs

    code 0: EasyPermissions.requestPermissions(this, "To function properly, App needs your permissions. Allow permissions for App", RC_REQUIRED_PERM, REQUESTED_PERMISSIONS_ON_START);

    code 1:

    1

    code 2:

    2

    // TODO(you): show the code that produces the problem, execute code 0 in onStart() ex. go to background and returning to application more than 1 time

    bug fix-implemented 
    opened by mgolebiowski95 13
  • Remove all APIs that use framework fragments

    Remove all APIs that use framework fragments

    @samtstern The Android team announced their decision to kill all framework fragments so this PR deprecates all APIs that use those. It includes eventually getting rid of support for normal activities in some cases. Do you think that's okay?

    opened by SUPERCILEX 12
  • Why multiple request asked at the same time?

    Why multiple request asked at the same time?

    At starting of the app, I have READ_SMS permission and WRITE_EXTERNAL_STORAGE permission after signup. Now the issue is as soon as I allow READ_SMS permission, it asks me for WRITE_EXTERNAL_STORAGE permission after that only(signup not done). How to stop this behavior and ask user permission only when required.

    opened by vipulasri 12
  • No action when press negative button from EasyPermissions.requestPermissions()

    No action when press negative button from EasyPermissions.requestPermissions()

    Basic Information

    Device type: xiaomi redmi 3s; OS version: android 6.0.1; EasyPermissions version: version 1.1.2 and 1.1.3;

    Describe the problem

    No action when press negative button from EasyPermissions.requestPermissions() inside fragment.

    I expected that dialog will appear again.

    In version 1.1.1 everything is OK.

    All methods are from the box, nothing new.

    bug needs-info 
    opened by samvgorode 11
  • Crash when deny permission

    Crash when deny permission

    Basic Information

    Device type: Crash on Emulator and some real devices OS version: 6.0.0 EasyPermissions version: 1.1.0

    Describe the problem

    private final static int RC_CAMERA_AND_STORAGE = 1009;
        
        @AfterPermissionGranted(RC_CAMERA_AND_STORAGE)
        private void methodRequiresTwoPermission() {
            String[] perms = {Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE};
            if (EasyPermissions.hasPermissions(getContext(), perms)) {
            } else {
                // Do not have permissions, request them now
                //Crash here
                EasyPermissions.requestPermissions(this, getString(R.string.permission_camera_and_storage),
                        RC_CAMERA_AND_STORAGE, perms);
            }
        }
    
        @Override
        public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
            super.onRequestPermissionsResult(requestCode, permissions, grantResults);
    
            // Forward results to EasyPermissions
            EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this);
        }
    
        @Override
        public void onPermissionsGranted(int requestCode, List<String> list) {
        }
    
        @Override
        public void onPermissionsDenied(int requestCode, List<String> list) {
        }
    

    Crash when the user denies the permission request.

    logs

                                                                 at pub.devrel.easypermissions.RationaleDialogFragmentCompat.showAllowingStateLoss(RationaleDialogFragmentCompat.java:47)
                                                                 at pub.devrel.easypermissions.helper.BaseSupportPermissionsHelper.showRequestPermissionRationale(BaseSupportPermissionsHelper.java:29)
                                                                 at pub.devrel.easypermissions.helper.PermissionHelper.requestPermissions(PermissionHelper.java:75)
                                                                 at pub.devrel.easypermissions.EasyPermissions.requestPermissions(EasyPermissions.java:217)
                                                                 at pub.devrel.easypermissions.EasyPermissions.requestPermissions(EasyPermissions.java:119)
                                                                 at net.sample.SampleFragment.methodRequiresTwoPermission(SampleFragment.java:438)
    
    fix-implemented 
    opened by joepake 10
  • NullPointerException

    NullPointerException

    Basic Information

    Device type: Defy Mini OS version: 4.3.1 EasyPermissions version: 1.2.0

    Describe the problem

    Crashlytics reported this issue. Please take a look

    Code and logs

    Code

     @AfterPermissionGranted(RC_CONTACTS)
        private fun requestLocationPermission() {
            val perms = arrayOf(READ_CONTACTS, WRITE_CONTACTS)
            if (hasPermissions(this, *perms)) {
                getPhones()
            } else {
                requestPermissions(this, getString(R.string.msg_rationale_contacts),
                        RC_CONTACTS, *perms)
            }
        }
    
        override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>,
                                                grantResults: IntArray) {
            super.onRequestPermissionsResult(requestCode, permissions, grantResults)
            onRequestPermissionsResult(requestCode, permissions, grantResults, this)
        }
    
    

    Logs

    Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dmobisoft.contacts.update/pub.devrel.easypermissions.AppSettingsDialogHolderActivity}: java.lang.NullPointerException
           at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
           at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
           at android.app.ActivityThread.access$600(ActivityThread.java:141)
           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
           at android.os.Handler.dispatchMessage(Handler.java:99)
           at android.os.Looper.loop(Looper.java:137)
           at android.app.ActivityThread.main(ActivityThread.java:5103)
           at java.lang.reflect.Method.invokeNative(Method.java)
           at java.lang.reflect.Method.invoke(Method.java:525)
           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
           at dalvik.system.NativeStart.main(NativeStart.java)
    
    Caused by java.lang.NullPointerException
           at pub.devrel.easypermissions.b.a(Unknown Source)
           at pub.devrel.easypermissions.AppSettingsDialogHolderActivity.onCreate(Unknown Source)
           at android.app.Activity.performCreate(Activity.java:5133)
           at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
           at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
           at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
           at android.app.ActivityThread.access$600(ActivityThread.java:141)
           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
           at android.os.Handler.dispatchMessage(Handler.java:99)
           at android.os.Looper.loop(Looper.java:137)
           at android.app.ActivityThread.main(ActivityThread.java:5103)
           at java.lang.reflect.Method.invokeNative(Method.java)
           at java.lang.reflect.Method.invoke(Method.java:525)
           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
           at dalvik.system.NativeStart.main(NativeStart.java)
    
    opened by loihd 9
  • Version conflict with support lib version 27.1.1

    Version conflict with support lib version 27.1.1

    When I use this library with support library version 27.1.1, I'm getting error briefly version conflict with 27.1.0.

    Where can I tweak to get it fixed?

    opened by nareshkatta99 9
  • Added RationaleDialogCallback

    Added RationaleDialogCallback

    RationaleDialogCallback is an extension of PermissionCallbacks and forwards the rationale dialog buttons click events to the host that requesting a permission(s). RationaleDialogCallback is useful for events logging and is completely optional.

    Check out RationaleFragment in the sample app folder for example.

    opened by ernestkamara 9
  • doc: inconsistent sample code for AfterPermissionGranted annotation

    doc: inconsistent sample code for AfterPermissionGranted annotation

    Basic Information

    Device type: any OS version: any EasyPermissions version: 3.0.0

    Describe the problem

    The library sample code states that methods annotated with @AfterPermissionGranted for a specific request code are called when all requested permissions are granted, which can be confirmed in the library source code. However, in the README sample code, there is a check if the requested permissions have been granted, which is completely confusing and should be considered dead code.

    Code and logs

    README Sample Code

    @AfterPermissionGranted(RC_CAMERA_AND_LOCATION)
    private void methodRequiresTwoPermission() {
        String[] perms = {Manifest.permission.CAMERA, Manifest.permission.ACCESS_FINE_LOCATION};
        if (EasyPermissions.hasPermissions(this, perms)) {
            // Already have permission, do the thing
            // ...
        } else {
            // Do not have permissions, request them now
            EasyPermissions.requestPermissions(this, getString(R.string.camera_and_location_rationale),
                    RC_CAMERA_AND_LOCATION, perms);
        }
    }
    

    Library permissions grant check to call annotated methods

    https://github.com/googlesamples/easypermissions/blob/1d8c6e0854e6f0d1ea4482b7cffc416004f67e41/easypermissions/src/main/java/pub/devrel/easypermissions/EasyPermissions.java#L204-L206

    opened by freitzzz 0
  • CAPAC-8

    CAPAC-8

    Agregar un botón “Contacts” que inicia un nuevo Activity donde solicita acceso a la lista de contactos, mostrando un mensaje si esta fue aceptada o rechazada.

    opened by mmena05 1
  • Request: Make easypermissions library target to android api 33

    Request: Make easypermissions library target to android api 33

    opened by imandaliya 1
  • @samtstern This may be the same crash, without obfuscation. I got it during a stress test.

    @samtstern This may be the same crash, without obfuscation. I got it during a stress test.

    @samtstern This may be the same crash, without obfuscation. I got it during a stress test. Nexus 6, Android 7

    Caused by java.lang.NullPointerException
    Attempt to invoke direct method 'void pub.devrel.easypermissions.AppSettingsDialog.setActivityOrFragment(java.lang.Object)' on a null object reference
    
    Caused by java.lang.NullPointerException: Attempt to invoke direct method 'void pub.devrel.easypermissions.AppSettingsDialog.setActivityOrFragment(java.lang.Object)' on a null object reference
           at pub.devrel.easypermissions.AppSettingsDialog.fromIntent(AppSettingsDialog.java)
           at pub.devrel.easypermissions.AppSettingsDialogHolderActivity.onCreate(AppSettingsDialogHolderActivity.java)
           at android.app.Activity.performCreate(Activity.java:6679)
           at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
           at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
           at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
           at android.app.ActivityThread.-wrap12(ActivityThread.java)
           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
           at android.os.Handler.dispatchMessage(Handler.java:102)
           at android.os.Looper.loop(Looper.java:154)
           at android.app.ActivityThread.main(ActivityThread.java:6119)
           at java.lang.reflect.Method.invoke(Method.java)
           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
           at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:107)
    

    Originally posted by @artakka in https://github.com/googlesamples/easypermissions/issues/278#issuecomment-478466779

    opened by AwyNaibaho72 0
  • onRequestPermissionsResult() deprecated

    onRequestPermissionsResult() deprecated

    Basic Information

    Device type: Android Studio Bumblebee OS version: 2021.1.1 Patch 3 EasyPermissions version: 3.0.0

    The onRequestPermissionsResult() method is deprecated in Java.

    Please advise if this will be updated or if this will cause any problems in the future or not.

    opened by ktlotleng 0
  • onRequestPermissionsResult not called if user presses HOME button

    onRequestPermissionsResult not called if user presses HOME button

    With an EasyPermissions.requestPermissions() call, if the user presses the phone's HOME button instead of continuing on the initial message prompt, or during the system prompt to grant or refuse the permission, the onRequestPermissionResult() is never called, and also there is no call to onActivityResult(), so the activity waits in background forever for this result. I need to finish() this unnecessary activity (else much later it may cause an ANR), but there is no way of knowing what happened.

    opened by gregko 0
Releases(3.0.0)
  • 3.0.0(Jan 23, 2019)

    Version 3.0.0 contains a breaking change:

    • Move from using Android Support Libraries (com.android.support.*) to AndroidX libraries (androidx.*). If you are using the Android Support Libraries without using Jetifier this is a breaking change for you.

    The newly updated transitive dependencies are:

     <dependencies>
        <dependency>
          <groupId>androidx.appcompat</groupId>
          <artifactId>appcompat</artifactId>
          <version>1.0.2</version>
        </dependency>
        <dependency>
          <groupId>androidx.core</groupId>
          <artifactId>core</artifactId>
          <version>1.0.1</version>
        </dependency>
        <dependency>
          <groupId>androidx.fragment</groupId>
          <artifactId>fragment</artifactId>
          <version>1.0.0</version>
        </dependency>
      </dependencies>
    
    Source code(tar.gz)
    Source code(zip)
  • 2.0.1(Jan 15, 2019)

    Version 2.0.1 contains bug fixes for the following issue:

    • Crash when showing rationale in a FragmentActivity that is not an AppCompatActivity (#266)
    Source code(tar.gz)
    Source code(zip)
  • 2.0.0(Sep 24, 2018)

    Version 2.0.0 contains some breaking changes:

    • Drop support for android.app.Fragment, which is deprecated in Android 28. Apps that want to use EasyPermissions in a Fragment should use the Fragment class in the Android Support Library (AndroidX).
    • Remove all previously @Deprecated methods to clean up the API.

    This version also bumps the support library dependency from 27.1.1 to 28.0.0. This will be the last release using the old-style support library before moving to androidx.

    Source code(tar.gz)
    Source code(zip)
  • 1.3.0(Aug 6, 2018)

    Version 1.3.0 contains a new feature:

    • New setOpenInNewTask option when building the App Settings Dialog.

    This version also bumps the support library dependency from 27.1.0 to 27.1.1.

    Thanks to first time contributors @henriquenfaria and @sebkur :tada:

    Source code(tar.gz)
    Source code(zip)
  • 1.2.0(Mar 15, 2018)

    Version 1.2.0 contains a bug fix and a new feature:

    • New RationaleDialogCallbacks feature for detecting interactions with the rationale dialog (#208)
    • Fix for a bad cast (#201)

    This version also bumps the support library dependency from 27.0.2 to 27.1.0.

    Thanks to first time contributors @rayevg and @ernestkamara :tada:

    Source code(tar.gz)
    Source code(zip)
  • 1.1.3(Jan 25, 2018)

    Version 1.1.3 contains a bug fix for Issue #198 (via #199). This ensures results are forwarded to Fragments.

    This version also bumps the support library dependency from 27.0.1 to 27.0.2.

    Source code(tar.gz)
    Source code(zip)
  • 1.1.2(Jan 12, 2018)

    Version 1.1.2 contains a bug fix for Issue #193 (via #195). This prevents the permission rationale dialog from appearing multiple times in the same Activity.

    Source code(tar.gz)
    Source code(zip)
  • 1.1.1(Dec 13, 2017)

    Version 1.1.1 contains a fix to how EasyPermissions declares dependencies. The support library dependency is now properly declared in the pom.xml file (#187).

    Due to the explicit dependency on support library 27.0.1, you must use a compile SDK version of 27 or higher with this version.

    All users of EasyPermissions 1.1.0 should upgrade to 1.1.1.

    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Dec 6, 2017)

    Version 1.1.0 contains bug fixes, API improvements, and some deprecations:

    • New PermissionRequest builder API for passing arguments to EasyPermissions.requestPermissions via #180
      • Allows passing of theme argument for the rationale dialog (#174)
      • Replaces some of the requestPermissions overloads that had many arguments.
    • Improved Kotlin support with method and parameter annotations (#178)
    • Reduce the likelihood of #150 via #170

    Special thanks to @SUPERCILEX who spearheaded the new API changes.

    Source code(tar.gz)
    Source code(zip)
  • 1.0.1(Sep 26, 2017)

  • 1.0.0(Aug 30, 2017)

    Version 1.0.0 is the first major-version release of EasyPermissions! This reflects the overall stability of the API and library internals.

    API Changes

    • AppSettingsDialog.Builder#Builder([Activity/Fragment/android.app.Fragment], String) constructors removed. Use AppSettingsDialog.Builder#setRationale([String/int]) instead or leave blank to use the default rationale message.
    • AppSettingsDialog.Builder#setNegativeButton(String, DialogInterface.OnClickListener) removed. To know if a user cancelled the request, check if your permissions were given with EasyPermissions#hasPermissions(...) in Activity#onActivityResult(...). If you still don't have the right permissions, then the request was cancelled.

    New features

    • You can now specify a custom theme for AppSettingsDialog via AppSettingsDialog.Builder#setThemeResId(int)
    • In addition, if you use AppCompat color theming and have the three basic colors setup (color{Primary,PrimaryDark,Accent}), AppSettingsDialog will automatically use them to correctly style the dialog based on your app's theme instead of using the system defaults.

    Bug fixes

    • Use support and framework dialog implementations where applicable (#142 and #156)
    • appcompat-v7 dependency is no longer leaked to consumers
    Source code(tar.gz)
    Source code(zip)
  • 0.4.3(Jul 27, 2017)

    This version of EasyPermissions has no behavior changes, but contains two developer improvements:

    • Consumer proguard rules are added (#137)
    • Javadoc JAR included in releases (#123)
    Source code(tar.gz)
    Source code(zip)
Android runtime permissions powered by RxJava2

RxPermissions This library allows the usage of RxJava with the new Android M permission model. Setup To use this library your minSdkVersion must be >=

Thomas Bruyelle 10.4k Jan 8, 2023
Android library for permissions request (updated 27.11.2017)

NoPermission Simple Android library for permissions request. Consists of only one class. Why NoPermission: Not a framework. It's just one class Dialog

Alexey Bykov 106 Dec 9, 2022
Simplifying Android Permissions

Gota Libary With Android 6.0 Marshmallow, Google introduced a new permission model that allows users to better understand why an application may be re

Abdullah Alhazmy 72 Nov 29, 2022
Simplify Android M system permissions

EasyPermissions EasyPermissions is a wrapper library to simplify basic system permissions logic when targeting Android M or higher. Note: If your app

Google Samples 9.6k Dec 30, 2022
🔓 Kotlin version of the popular google/easypermissions wrapper library to simplify basic system permissions logic on Android M or higher.

EasyPermissions-ktx Kotlin version of the popular googlesample/easypermissions wrapper library to simplify basic system permissions logic on Android M

Madalin Valceleanu 326 Dec 23, 2022
🔓 Kotlin version of the popular google/easypermissions wrapper library to simplify basic system permissions logic on Android M or higher.

?? Kotlin version of the popular google/easypermissions wrapper library to simplify basic system permissions logic on Android M or higher.

Madalin Valceleanu 327 Dec 30, 2022
A plugin system that runs like a browser, but instead of load web pages, it load apk plugins which runs natively on Android system.

Android Dynamic Loader Android Dynamic Loader is a plugin system. The host application is like a browser, but instead of load web pages, it load plugi

Tu Yimin 1.4k Dec 28, 2022
A declarative API to handle Android runtime permissions.

PermissionsDispatcher Fully Kotlin/Java support Special permissions support 100% reflection-free PermissionsDispatcher provides a simple annotation-ba

PermissionsDispatcher 11.1k Jan 2, 2023
Android runtime permissions powered by RxJava2

RxPermissions This library allows the usage of RxJava with the new Android M permission model. Setup To use this library your minSdkVersion must be >=

Thomas Bruyelle 10.4k Jan 8, 2023
Android library for permissions request (updated 27.11.2017)

NoPermission Simple Android library for permissions request. Consists of only one class. Why NoPermission: Not a framework. It's just one class Dialog

Alexey Bykov 106 Dec 9, 2022
Simplifying Android Permissions

Gota Libary With Android 6.0 Marshmallow, Google introduced a new permission model that allows users to better understand why an application may be re

Abdullah Alhazmy 72 Nov 29, 2022
Android Library to help you with your runtime Permissions.

PermissionHelper Android Library to help you with your runtime Permissions. Demo Android M Watch it in action. Pre M Watch it in action. Nexus 6 (M) N

Kosh Sergani 1.2k Dec 14, 2022
Simplifying Android Permissions

Gota Libary With Android 6.0 Marshmallow, Google introduced a new permission model that allows users to better understand why an application may be re

Abdullah Alhazmy 72 Nov 29, 2022
Android Library for requesting Permissions with Kotlin Coroutines or AndroidX LiveData

PEKO PErmissions with KOtlin Android Permissions with Kotlin Coroutines or LiveData No more callbacks, builders, listeners or verbose code for request

Marko Devcic 133 Dec 14, 2022
Get a unique ID for Android devices without any permissions.

Java and Kotlin Android library. Uniquely identify an Android device without any permissions and API restrictions. The recommended approach using DRM API.

Eyosiyas Bereketab 9 Aug 25, 2022
Android permissions as suspend functions

Warden Permission handling in Android can be complicated. It requires boilerplate code to setup the permission request, receive the result and then fo

Alex Styl 183 Nov 2, 2022
A Android app Permissions with Kotlin Flow APIs

Know about real-time state of a Android app Permissions with Kotlin Flow APIs. Made with ❤️ for Android Developers.

Shreyas Patil 281 Dec 30, 2022
Sentinel is a simple one screen UI which provides a standardised entry point for tools used in development and QA alongside device, application and permissions data.

Sentinel Sentinel is a simple one screen UI that provides standardised entry point for tools used in development and QA alongside device, application

Infinum 29 Dec 12, 2022
Easy way to handle all permissions

BestPermissionUtil You can read the story from here https://hamurcuabi.medium.com/permissions-with-the-easiest-way-9c466ab1b2c1 Prerequisites Add this

Emre Hamurcu 8 May 12, 2022
Oratio Library for Android Studio helps you simplify your Android TTS codes

Oratio Oratio is a library for Android Studio. This library is useful to a number of developers who are currently making apps using android TTS(Text-T

Jacob Lim 1 Oct 28, 2021