filmov
tv
Requesting Permissions at Runtime in Android Java

Показать описание
There are two types of permissions:
normal permissions and dangerous permissions.
Normal Permissions
Normal permissions do not directly affect the user’s privacy. If the application lists a normal permission in its manifest, then these permissions will be automatically granted by the system upon installation. Some of the most common normal permissions are check and change data connection, include network state, and include wi-fi state.
Dangerous Permissions
Dangerous permissions give an application access to the user’s private data or affect the system and other apps. If you list a dangerous permission in manifest, then the user has to explicitly give permission to your application.
Advantages of Runtime Permissions
In Android 6.0, applications provide transparency to users. Users have to grant permissions to applications while the application is running rather than during installation. The phone asks the user to grant permission only when some specific function is being used within an app. At that point, users have to decide whether or not to grant their permission.
In the earlier versions of Android 6.0, a user had to grant all the app permissions before installing from the Play Store, and if he or she didn’t allow the permission, then the system wouldn’t install the application at all. As a result, many malicious apps were able to access user private data after granting the permission at installation time, which led to a major security breach.
In Marshmallow, the user can allow or deny individual permission and the application can continue run with limited efficiencies even if the user denies a permission request. In addition, users now have the option to revoke individual app permissions after he or she has granted them, but in the earlier versions to Marshmallow, the user couldn’t revoke individual app permissions.