Using the new runtime permission model involves the following:
- Check to see whether you have the desired permissions
- If not, check whether we should display the rationale (meaning the request was previously denied)
- Request the permission; only the OS can display the permission request
- Handle the request response
Here are the corresponding methods:
- ContextCompat.checkSelfPermission
- ActivityCompat.requestPermissions
- ActivityCompat.shouldShowRequestPermissionRationale
- onRequestPermissionsResult
Even though you are requesting permissions at runtime, the desired permission must be listed in the Android Manifest. If the permission is not specified, the OS will automatically deny the request.