Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Easypermissions | 9,673 | 1 | a month ago | 3 | August 13, 2019 | 28 | apache-2.0 | Java | ||
Simplify Android M system permissions | ||||||||||
Permissionskit | 5,213 | 2 | a month ago | 67 | November 01, 2021 | 5 | mit | Swift | ||
Universal API for request permission and get its statuses. | ||||||||||
Dexter | 5,003 | 741 | 9 | 2 years ago | 34 | July 02, 2021 | 34 | apache-2.0 | Java | |
Android library that simplifies the process of requesting permissions at runtime. | ||||||||||
Permissionx | 2,659 | 8 months ago | 10 | September 18, 2022 | 2 | apache-2.0 | Kotlin | |||
An open source Android library that makes handling runtime permissions extremely easy. | ||||||||||
Tedpermission | 1,572 | a year ago | 8 | October 27, 2021 | 22 | Java | ||||
Easy check permission library for Android Marshmallow | ||||||||||
Quickpermissions | 432 | 5 years ago | 5 | apache-2.0 | Kotlin | |||||
The most easiest way to handle Android Runtime Permissions | ||||||||||
Fcpermissions | 404 | 7 years ago | 5 | Java | ||||||
Fuck the permissions in Android M | ||||||||||
Permissify | 373 | 7 years ago | 1 | mit | Java | |||||
Simplifying Android Permissions | ||||||||||
Locus Android | 306 | 16 days ago | 1 | January 11, 2022 | 10 | apache-2.0 | Kotlin | |||
An Awesome Kotlin Location library to retrieve location merely in 3 lines of code | ||||||||||
Permissiongrantor | 286 | 4 years ago | 1 | Java | ||||||
一行代码搞定Android6.0动态权限授权、权限管理 || Android permission grantor util |
fix bug on XiaoMi device
update dialog style
set minSdkVersion to 14
申请授权不依赖于Activity对象
An Android permission grant util which is concise and easy to use. Normally you need to request permission in an Activity or Fragment and get the result by inheriting its method:
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
@NonNull int[] grantResults) {
/* callback - no nothing */
}
If you request permissions in other Class(for example in a widget), things will become complicated. Grantor handle permission in alone Activity and simplify the work, when user deny permission, by default it's can show a dialog to explain why you need the permission, of course you can config it not to show the explaining dialog.
dependencies {
compile 'com.github.dfqin:grantor:2.5'
}
PermissionsUtil.requestPermission(Context context, PermissionListener listener, String[] permissions);
private void requestCemera() {
PermissionsUtil.requestPermission(getApplication(), new PermissionListener() {
@Override
public void permissionGranted(@NonNull String[] permissions) {
Toast.makeText(MainActivity.this, "访问摄像头", Toast.LENGTH_LONG).show();
}
@Override
public void permissionDenied(@NonNull String[] permissions) {
Toast.makeText(MainActivity.this, "用户拒绝了访问摄像头", Toast.LENGTH_LONG).show();
}
}, Manifest.permission.CAMERA);
}
private void requestReadContact() {
PermissionsUtil.TipInfo tip = new PermissionsUtil.TipInfo("注意:", "我就是想看下你的通讯录", "不让看", "打开权限");
PermissionsUtil.requestPermission(this, new PermissionListener() {
@Override
public void permissionGranted(@NonNull String[] permissions) {
JSONArray arr = null;
try {
arr = getContactInfo(MainActivity.this);
if (arr.length() == 0) {
Toast.makeText(MainActivity.this, "请确认通讯录不为空且有访问权限", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(MainActivity.this, arr.toString(), Toast.LENGTH_LONG).show();
}
} catch (JSONException e) {
e.printStackTrace();
}
}
@Override
public void permissionDenied(@NonNull String[] permissions) {
Toast.makeText(MainActivity.this, "用户拒绝了读取通讯录权限", Toast.LENGTH_LONG).show();
}
}, new String[]{Manifest.permission.READ_CONTACTS}, true, tip);
}
private void requestSms() {
PermissionsUtil.requestPermission(this, new PermissionListener() {
@Override
public void permissionGranted(@NonNull String[] permissions) {
Toast.makeText(MainActivity.this, "访问消息", Toast.LENGTH_LONG).show();
}
@Override
public void permissionDenied(@NonNull String[] permissions) {
Toast.makeText(MainActivity.this, "用户拒绝了读取消息权限", Toast.LENGTH_LONG).show();
}
}, new String[]{Manifest.permission.READ_SMS}, false, null);
}
The MIT License (MIT) Copyright (c) 2017, dfqin