Please accept YouTube cookies to play this video. By accepting you will be accessing content from YouTube, a service provided by an external third party.

YouTube privacy policy

If you accept this notice, your choice will be saved and the page will refresh.

 

Show the video description

In this video we will learn, how to use the EasyPermissions library to request a dangerous permission at run time, which is necessary since Android Marshmallow (API level 23). This library provides an easy way to request multiple permissions at once, handle the results (granted or denied), show a rationale when the user previously denied a permission with an explanation of why this permission is needed and it even provides an easy way to create an AlertDialog that sends the user directly to the settings of the phone to manually grant a permission if he previously checked the “don’t ask again” box.

Important Linksactivity_main.xmlMainActivity.javaAndroidManifest.xml

Library on GitHub with dependency + instructions:

github.com/googlesamples/easypermissions