Pro Android with Kotlin
Download 5.42 Mb. Pdf ko'rish
|
@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: Or if you need to specify permissions for API levels 23 or higher (Android 6.0), use this: 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 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. |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling