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
  • 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 0
  • @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
  • onRequestPermissionsResult not called in non-activity class

    onRequestPermissionsResult not called in non-activity class

    Device type: Redmi note 8 pro OS version: Android 11 EasyPermissions version: com.vmadalin:easypermissions-ktx:1.0.0_

    I am making a helper class for EasyPermissions. The request dialog is being shown but the onRequestPermissionsResult is not being called inside the helper class. Its working fine if its inside an activity. Is there anyway in which onRequestPermissionsResult can be called from a non-activity class?

    Code

    
       fun requestPermission(
            rationale: String,
            REQUEST_CODE: Int,
            permissions: String,
        ) {
            EasyPermissions.requestPermissions(
                mActivity,
                rationale,
                REQUEST_CODE,
                permissions
            )
        }
    
       override fun onRequestPermissionsResult(
            requestCode: Int,
            permissions: Array<out String>,
            grantResults: IntArray
        ) {
            EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, mContext)
        }
    
    opened by go-ammar 1
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 Nov 25, 2022
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 105 Nov 15, 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 73 Jul 24, 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 Nov 16, 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 323 Nov 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 323 Nov 23, 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 Nov 19, 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
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
Gits-android-extensions - A collection of Kotlin extensions to simplify Android development

gits-android-extensions A collection of Kotlin extensions to simplify Android de

GITS Indonesia 3 Feb 3, 2022
An Android Dialog Lib simplify customization.

FlycoDialog-Master 中文版 An Android Dialog Lib simplify customization. Supprot 2.2+. Features [Built-in Dialog, convenient to use](#Built-in Dialog) [Ab

Flyco 2.3k Nov 23, 2022
Simplify Adapter creation for your Android ListViews.

FunDapter takes the pain and hassle out of creating a new Adapter class for each ListView you have in your Android app. It is a new approach to custom

Ami Goldenberg 288 Nov 25, 2022
ModernStorage is a group of libraries that provide an abstraction layer over storage on Android to simplify its interactions

ModernStorage ModernStorage is a group of libraries that provide an abstraction layer over storage on Android to simplify its interactions by apps dev

Google 1.1k Nov 26, 2022
This project aims to simplify creation of basic Arduino programs by just editing a UI on Android.

ArdUI A video explanation If you are more a fun of video explanation go to this youtube video Project aim This project aims to simplify creation of ba

Targist 21 Nov 19, 2022
DSC Moi University session on using Navigation components to simplify creating navigation flow in our apps to use best practices recommended by the Google Android Team

Navigation Components Navigate between destination using safe args How to use the navigation graph and editor How send data between destinations Demo

Breens Mbaka 6 Feb 3, 2022
kotlin dsl for kids to simplify RecyclerView.Adapter logic

KidAdapter RecyclerView adapter for kids. A kotlin dsl mechanism to simplify and reduce boilerplate logic of a RecyclerView.Adapter. With KidAdapter y

Eugeniu Tufar 56 Nov 27, 2022
Gradle plugin for simplify Kotlin Multiplatform mobile configurations

Mobile Multiplatform gradle plugin This is a Gradle plugin for simple setup of Kotlin Multiplatform mobile Gradle modules. Setup buildSrc/build.gradle

IceRock Development 78 Sep 27, 2022
This repository demonstrates how Kotlin can simplify Spring Boot configuration properties file mapping

Kotlin spring-boot nested config props This repository demonstrates how Kotlin can simplify Spring Boot configuration properties file mapping @Constru

Maksim Kostromin 1 Oct 11, 2021
General purpose parsing framework. Simplify parsing of text

General purpose parsing framework. Simplify parsing of text. Allows capture complex nested formats with simple and human-readable syntax.

Roman 1 Nov 16, 2021
Utility library dedicated for functional & non-functional codebases to simplify modelling of success and failure responses for the JVM languages 🔀

Expressible Utility library, part of the panda-lang SDK, dedicated for functional codebases that require enhanced response handling. Express yourself

Panda 28 Nov 14, 2022