### Request Special Android Unknown App Sources Permission with SoulPermission Source: https://github.com/soulqw/soulpermission/blob/master/README.md Illustrates how to check and request a special Android permission, such as installing unknown apps (`Special.UNKNOWN_APP_SOURCES`). It uses `SoulPermission.getInstance().checkAndRequestPermission()` with a `SpecialPermissionListener` to handle callbacks for when the permission is granted (`onGranted`) or denied (`onDenied`). ```Java //if you want do noting or no need all the callbacks you may use SimpleSpecialPermissionAdapter instead SoulPermission.getInstance().checkAndRequestPermission(Special.UNKNOWN_APP_SOURCES, new SpecialPermissionListener() { @Override public void onGranted(Special permission) { Toast.makeText(ApiGuideActivity.this, "install unKnown app is enable now", Toast.LENGTH_SHORT).show(); } @Override public void onDenied(Special permission) { Toast.makeText(ApiGuideActivity.this, "install unKnown app is disable yet", Toast.LENGTH_SHORT).show(); } }); ``` -------------------------------- ### Check Single Android Permission Status with SoulPermission Source: https://github.com/soulqw/soulpermission/blob/master/README.md Provides an example of checking the current status of a single Android permission (e.g., `Manifest.permission.ACCESS_FINE_LOCATION`) without initiating a request. The `SoulPermission.getInstance().checkSinglePermission()` method returns a `Permission` object indicating the permission's current state. ```Java //you can also use checkPermissions() for a series of permissions Permission checkResult = SoulPermission.getInstance().checkSinglePermission(Manifest.permission.ACCESS_FINE_LOCATION); ``` -------------------------------- ### Navigate to Application Settings Page with SoulPermission Source: https://github.com/soulqw/soulpermission/blob/master/README.md Shows how to programmatically navigate the user to the application's detailed settings page. `SoulPermission.getInstance().goApplicationSettings()` can optionally take a `GoAppDetailCallBack` to notify when the user returns from the settings screen, allowing for post-settings actions. ```Java SoulPermission.getInstance().goApplicationSettings(new GoAppDetailCallBack() { @Override public void onBackFromAppDetail(Intent data) { //if you need to know when back from app detail Utils.showMessage(view, "back from go appDetail"); } }); ``` -------------------------------- ### Request Multiple Android Permissions with SoulPermission Source: https://github.com/soulqw/soulpermission/blob/master/README.md Illustrates how to request multiple Android permissions simultaneously (e.g., `Manifest.permission.CAMERA`, `Manifest.permission.WRITE_EXTERNAL_STORAGE`) using `SoulPermission.getInstance().checkAndRequestPermissions()`. It provides callbacks for when all permissions are granted (`onAllPermissionOk`) or when any are denied (`onPermissionDenied`), enabling batch permission handling. ```Java SoulPermission.getInstance().checkAndRequestPermissions( Permissions.build(Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE), //if you want do noting or no need all the callbacks you may use SimplePermissionsAdapter instead new CheckRequestPermissionsListener() { @Override public void onAllPermissionOk(Permission[] allPermissions) { Toast.makeText(ApiGuideActivity.this, allPermissions.length + "permissions is ok" + " \n you can do your operations", Toast.LENGTH_SHORT).show(); } @Override public void onPermissionDenied(Permission[] refusedPermissions) { Toast.makeText(ApiGuideActivity.this, refusedPermissions[0].toString() + " \n is refused you can not do next things", Toast.LENGTH_SHORT).show(); } }); ``` -------------------------------- ### Enable Debug Mode for SoulPermission Logging Source: https://github.com/soulqw/soulpermission/blob/master/README.md Demonstrates how to enable debug mode for the `SoulPermission` library. Calling `SoulPermission.setDebug(true)` will activate detailed logging, which is useful for debugging and understanding the library's internal operations. ```Java SoulPermission.setDebug(true); ``` -------------------------------- ### Handle Permission Rationale with SoulPermission Source: https://github.com/soulqw/soulpermission/blob/master/README.md Shows how to manage the `shouldShowRequestPermissionRationale` scenario when requesting a permission (e.g., `Manifest.permission.READ_CONTACTS`). The `onPermissionDenied` callback checks `permission.shouldRationale()` to determine if an explanation should be displayed to the user before retrying the permission request. ```Java SoulPermission.getInstance().checkAndRequestPermission(Manifest.permission.READ_CONTACTS, new CheckRequestPermissionListener() { @Override public void onPermissionOk(Permission permission) { Toast.makeText(ApiGuideActivity.this, permission.toString() + "\n is ok , you can do your operations", Toast.LENGTH_SHORT).show(); } @Override public void onPermissionDenied(Permission permission) { // see CheckPermissionWithRationaleAdapter if (permission.shouldRationale()) { Toast.makeText(ApiGuideActivity.this, permission.toString() + " \n you should show a explain for user then retry ", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(ApiGuideActivity.this, permission.toString() + " \n is refused you can not do next things", Toast.LENGTH_SHORT).show(); } } }); ``` -------------------------------- ### Request Single Android Permission with SoulPermission Source: https://github.com/soulqw/soulpermission/blob/master/README.md Demonstrates how to check and request a single Android permission (e.g., `Manifest.permission.ACCESS_FINE_LOCATION`) using `SoulPermission.getInstance().checkAndRequestPermission()`. It includes callbacks for successful permission grant (`onPermissionOk`) and denial (`onPermissionDenied`), allowing for immediate follow-up actions. ```Java SoulPermission.getInstance().checkAndRequestPermission(Manifest.permission.ACCESS_FINE_LOCATION, //if you want do noting or no need all the callbacks you may use SimplePermissionAdapter instead new CheckRequestPermissionListener() { @Override public void onPermissionOk(Permission permission) { Toast.makeText(ApiGuideActivity.this, permission.toString() + "\n is ok , you can do your operations", Toast.LENGTH_SHORT).show(); } @Override public void onPermissionDenied(Permission permission) { Toast.makeText(ApiGuideActivity.this, permission.toString() + " \n is refused you can not do next things", Toast.LENGTH_SHORT).show(); } }); ``` -------------------------------- ### Configure SoulPermission to Skip Old ROM Permission Checks Source: https://github.com/soulqw/soulpermission/blob/master/README.md Explains how to configure `SoulPermission` to skip permission checks on older Android ROMs where permissions might be granted by default. Calling `SoulPermission.skipOldRom(true)` ensures that the library behaves appropriately on legacy systems. ```Java SoulPermission.skipOldRom(true); ``` -------------------------------- ### Check Special Android Notification Permission with SoulPermission Source: https://github.com/soulqw/soulpermission/blob/master/README.md Demonstrates how to check the status of a special Android permission, specifically notification access, using `SoulPermission.getInstance().checkSpecialPermission(Special.NOTIFICATION)`. This method returns a boolean indicating if the special permission is granted. ```Java boolean checkResult = SoulPermission.getInstance().checkSpecialPermission(Special.NOTIFICATION); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.