Pro Android with Kotlin


Download 5.42 Mb.
Pdf ko'rish
bet95/223
Sana04.11.2023
Hajmi5.42 Mb.
#1746807
1   ...   91   92   93   94   95   96   97   98   ...   223
Bog'liq
@de android telegram Pro Android with Kotlin Developing Modern Mobile


parts of your apps.
As for the built-in permissions, they are defined by the system, and if your app needs one 
or several of them, you declare using them (see the “Permissions” section of the online text 
companion). The system will then decide based on the protection level what to do with these 
permission requests. If your app exposes sensitive information to other apps or the system 
and it is not handled by permissions used by the app, you define your own permissions 
inside AndroidManifest.xml.
Note The mapping of permissions to permission groups may change with future versions of 
Android. Your app thus should not rely on such a mapping. From a development perspective, you 
should just ignore permission groups, unless you define your own permissions and permission 
groups.


105
CHAPTER 7: Permissions
android:icon="drawable resource"
android:label="string resource"
android:name="string"
android:permissionGroup="string"
android:protectionLevel=["normal" | "dangerous" |
"signature" | "signatureOrSystem"] />
The meaning of these attributes are described in the section “Manifest Top Level Entries” 
of the online text companion. At a bare minimum, you must provide the name and 
protectionLevel attributes, but it certainly is a good idea to also add a label, icon, and a 
description to help your users understand what the permission does.
If you need to group your permissions, you can use one of two methods.

Use the 
 element and add permissionGroup 
attributes to 
; see the section “Manifest Top Level Entries” 
in the online text companion.

Use the 
 element and name your permissions 
accordingly; see the ”Manifest Top Level Entries” section in the online 
text companion.
If you then acquire a permission of a group, the sibling permissions from the same group will 
be implicitly included in the grant.
Using Permissions
To use permissions, inside your AndroidManifest.xml file add one or more, as shown here:
android:maxSdkVersion="integer" />
Or if you need to specify permissions for API levels 23 or higher (Android 6.0), use this:
android:maxSdkVersion="integer" />
In both cases, the name attribute specifies the permission name, and maxSdkVersion is the 
maximum API level this permission requirement will take into account. This special permission-sdk23> element comes from a major change in permission semantics for 
Android 6.0. If you don’t care for that distinction, just omit the maxSdkVersion attribute.
Caution To adhere to security guidelines and to make your app design clear and stable, keep the 
number of permissions you define yourself at the bare minimum.



Download 5.42 Mb.

Do'stlaringiz bilan baham:
1   ...   91   92   93   94   95   96   97   98   ...   223




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling