Requesting Permissions at Runtime in Android Java

Publicado el: 02 febrero 2021
en el canal de: Sayed Ali Yahya Azhar
421
8

Google has changed the way that applications handle permissions. Before, we only dealt with permissions in AndroidManifest.xml, but starting with Android 6.0, we need to check every time for permission-related tasks. Applications need to ask the permission at runtime while they are running and also have to provide enough context on why the permissions are required. Though we have to declare in manifest whenever an application wants to access APIs that need the runtime permission, apps have to check whether that permission has been granted or request the required permission using the support library.


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.


En esta página del sitio puede ver el video en línea Requesting Permissions at Runtime in Android Java de Duración hora minuto segunda en buena calidad , que subió el usuario Sayed Ali Yahya Azhar 02 febrero 2021, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 421 veces y le gustó 8 a los espectadores. Disfruta viendo!