Requesting Permissions from the User
Our app might want to implement certain features that are deemed to be dangerous by Google. This usually means access to those features could risk the user's privacy. Those permissions may, for example, allow you to read users' messages or determine their current location.
Depending on the particular permission and the target Android API level we are developing, we may need to request that permission from the user. If the device is running on Android 6 (Marshmallow, or API level 23), and the target API of our app is 23 or higher, which it almost certainly will be, as most devices by now will run newer versions of Android, there will be no user notifications alerting the user of any permissions requested by the app at install time. Instead, our app must ask the user to grant it those permissions at runtime.
When we request a permission, the user sees a dialog much like the one shown in the following screenshot: