Permissions
User Permissions
- Are declared in the AndroidManifest.xml as strings
- They are in the tag <user-permission>
- <user-permission android:name="android.permission.CAMERA">
- <user-permission android:name="android.permission.INTERNET">
- <uses-permission android:name="android.permission.READ_CONTACTS" > - Allows to read the contact information from your list
- These permissions must be accepted before the application runs
App Permissions
- The application's permissions to interact with another application is specified in the tag <permission>
How to use permissions between Apps
- Invoking application
- In the AndroidManifest.xml add the <user-permission> that is allow by the application
- <uses-permission android:name="course.examples.permissionexample.BOOM_PERM" />
- Calling application
- In the AndroidManifest.xml define the permission with the tag <permission>
android:name="course.examples.permissionexample.BOOM_PERM"
android:description="@string/boom_perm_string"
android:label="@string/boom_permission_label_string">
</permission>
Component Permissions
- Take precedence over application permissions
- Checked within execution of:
- startActivity()
- startActivityForReult()
- Throws securityException on failure case
Types of Component Permissions
- Activity Permissions
- Checked within execution of
- startActivity
- startActivityForResult
- Service Permissions
- Checked within execution of
- Context.startService()
- Context.stopService()
- Context.bindService()
- BroadcasterReceiver Permissions
- Restrict which components can send & receive broadcasts
- ContentProvider Permissions
- Restrict which components can read & write data in a ContentProvider
Comentarios
Publicar un comentario