Recipe Declaring and Enforcing Permissions

Permissions can be assigned to activities, broadcast receivers, content providers, and serv-ices.To assign a permission, the permission element needs to be declared in the desired Android component in the AndroidManifest XML file. For example:

<permission android:name="com.myapp" android:label="my app" android:description="using my app"

android:permissionGroup="android.permission-group.COST_MONEY" android:protectionLevel="dangerous" />

This provides a method not only to specify the permission needed, but also the level of access with the protectionLevel attribute.There are four levels of access: normal, dangerous, signature, and signatureOrSystem.The permissionGroup attribute is used only to help the system display permissions to the user, which is optional. The possible permission groups are

permission

group:

: android.

•permission-

-group.

.DEVELOPMENT_TOOLS

permission

group:

: android.

•permission-

-group.

.PERSONAL_INFO

permission

group:

: android.

•permission-

-group.

.COST_MONEY

permission

group:

: android.

•permission-

-group.

•LOCATION

permission

group:

: android.

•permission-

-group.

•MESSAGES

permission

group:

: android.

•permission-

-group.

.NETWORK

permission

group:

: android.

•permission-

-group.

•ACCOUNTS

permission

group:

: android.

•permission-

-group.

.STORAGE

permission

group:

: android.

•permission-

-group.

.PHONE_CALLS

permission

group:

: android.

•permission-

-group.

. HARDWARE_CONTROLS

permission

group:

: android.

•permission-

-group.

SYSTEM_TOOLS

The label, description, and name attributes are ways to make the permission more descriptive.

Character Building Thought Power

Character Building Thought Power

Character-Building Thought Power by Ralph Waldo Trine. Ralph draws a distinct line between bad and good habits. In this book, every effort is made by the writer to explain what comprises good habits and why every one needs it early in life. It draws the conclusion that habits nurtured in early life concretize into impulses in future for the good or bad of the subject.

Get My Free Ebook


Post a comment