Skip to content
This repository was archived by the owner on Oct 31, 2022. It is now read-only.

Commit d3e37fc

Browse files
author
Mukesh Solanki
committed
Updated Readme
1 parent 3e0fa09 commit d3e37fc

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Runtime Permission Library (Example)
22
A simple library that will remove all the boilerplate code and speed up your work with new Runtime Permissions introduced in Android M.
33
## What are Runtime Permissions?
4+
45
<img src="http://chintanrathod.com/wp-content/uploads/2015/06/Android-M-Permission1.jpg" width="500" height="839" />
6+
57
Google docs is [here](https://developer.android.com/preview/features/runtime-permissions.html). Unlike the traditional way of asking permission Android M increased its security by enforcing apps to ask permissions on the fly as and when the user requests for a feature that requires those permissions. These permissions can also be revoked by the user at any time.
68
## How to integrate into your app?
79
Integrating the library into you app is extremely easy. A few changes in the build gradle and your all ready to user Runtime permissions library. Make the following changes to build.gradle inside you app.
@@ -28,16 +30,16 @@ This will create an object of the Runtime Permission class for you. Make sure it
2830
To check if the app has a specific permission you can call `runtimePermission.hasPermission(Activity activity, String permission);` or if you want to check
2931
whether the app has multiple permission you can call `runtimePermission.hasPermissions(Activity activity, String[] permissions)`.
3032

31-
You can request for a permission by calling `runtimePermission.requestPermission(Activity activity, String permission, int requestCode)` or request multiple
32-
permissions by calling `runtimePermission.requestPermission(Activity activity, String[] permissions, int requestCode)`. However you will need to override a
33-
method on your activity inorder to wait for a callback from the library. Just add this to you activity.
34-
35-
<img src="https://d262ilb51hltx0.cloudfront.net/max/800/1*DJTWuO_J8QxKciSAjFWQCg.png" />
33+
<img src="https://d262ilb51hltx0.cloudfront.net/max/800/1*DJTWuO_J8QxKciSAjFWQCg.png" width="400" height="250" />
3634

3735
or like how google requests for multiple permissions
3836

3937
<img src="http://pic.youmobile.org/imgcdn/App-permissions-coming-in-Android-M.jpg" />
4038

39+
You can request for a permission by calling `runtimePermission.requestPermission(Activity activity, String permission, int requestCode)` or request multiple
40+
permissions by calling `runtimePermission.requestPermission(Activity activity, String[] permissions, int requestCode)`. However you will need to override a
41+
method on your activity inorder to wait for a callback from the library. Just add this to you activity.
42+
4143
```
4244
@Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
4345
super.onRequestPermissionsResult(requestCode, permissions, grantResults);

0 commit comments

Comments
 (0)