Overview of Permissions in Android

Learn about app permissions and why we would need them.

This lesson provides a brief overview of permissions in Android. Over the years, the handling of app permissions and runtime permissions has evolved significantly, and the latest versions of Android require the app to only request permissions that are absolutely necessary for the application to function.

The Android system requires the application to ask for permission when it tries to access either restricted data or when it tries to perform a restricted action. Permissions can be broadly categorized into two types, which are described below.

Install time permissions

These permissions are granted to the application when the user installs the application to their device from the Play Store. The Play Store displays a notice listing all the install time permissions requested by the app. For example, if our app requires access to the internet, then we can simply define the permission in the AndroidManifest.xml, and it will be granted to our application at install time.

Runtime permissions

These permissions are granted whenever a running application explicitly requests them. It’s recommended that we request runtime permissions just before performing a restricted action or accessing restricted data. For example, to access file storage for media, we need to request runtime permission from the user.

The image below shows a sample screen that’s presented to the user when the app requests runtime permissions.

Requesting external storage permissions
Requesting external storage permissions

Conclusion

This lesson provided a brief overview of Android app install time and runtime permissions. It’s essential to understand that asking for unnecessary permissions could annoy the user and could lead to a lower level of user trust.