In a number of the example projects created in preceding chapters, changes have been made to the AndroidManifest.xml file to request permission for the app to perform a specific task. In a couple of instances, for example, internet access permission has been requested in order to allow the app to download and display web pages.
In each case up until this point, the addition of the request to the manifest has been all that is required in order for the app to obtain permission from the user to perform the designated task. There are, however, a number permissions for which additional steps are required in order for the app to function when running on Android 6.0 or later. The first of these so-called “dangerous” permissions will be encountered in the next chapter.
Before reaching that point, however, this chapter will outline the steps involved in requesting such permissions when running on the latest generations of Android. 55.1 Understanding Normal and Dangerous Permissions Android enforces security by requiring the user to grant permission for an app to perform certain tasks.
Prior to the introduction of Android 6, permission was always sought at the point that the app was installed on the device. Figure 55-1, for example, shows a typical screen seeking a variety of permissions during the installation of an app via Google Play.
For many types of permission this scenario still applies for apps on Android 6.0 or later. These permissions are referred to as normal permissions and are still required to be accepted by the user at the point of installation.
A second type of permission, referred to as dangerous permissions must also be declared within the manifest file in the same way as a normal permission, but must also be requested from the user when the application is first launched.