English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Android Permission Operation: Uses-Detailed Explanation of Permission

This article instance explains the Android permission operation of uses-permission. Shared for everyone's reference, as follows:

When we install Android software, the system will prompt the permissions required by the software. Compared to other systems, Android has a large number of permissions. When we develop software, we also need to declare the corresponding permissions, such as if we want the software to send text messages, we need to declare the permission for the software to call the SMS, otherwise the software will report an error when it runs.

Android permissions are configured in the AndroidManifest.xml file. The AndroidManifest file contains four tags related to permission, namely <permission>、 <permission-group> , <permission-tree> and <uses-permission> in our manifest file. The most commonly used ones are <uses-permission>, when we need to obtain a certain permission, we must declare the <uses-permission>.

<?xml version="1.0" encoding="utf-8"?>
<manifest>
  <application>
  </application>
  <uses-permission />
  <permission />
  <permission-tree />
  <permission-group />
  ...
</manifest>

<permission> and <uses-The 'permission' tag serves a similar function, and the differences between the two lie in the <uses-The 'permission' tag is a predefined permission in Android, while <permission> is a custom-defined permission. The <permission> tag is used relatively less frequently, <permission-group> <permission-These two tags are less common, to put it simply <permission-The 'group' tag is used to declare a label, which represents a group of permissions, and <permission-This is a namespace defined for a group of permissions. The specific usage of the next three tags will be introduced in subsequent articles.

<permission> is defined as follows:

<permission android:description="string resource"
      android:icon="drawable resource"
      android:label="string resource"
      android:name="string"
      android:permissionGroup="string"
      android:protectionLevel=["normal" | "dangerous" |
                   "signature" | "signatureOrSystem"] />

The above code is from the official document: http://developer.android.com/guide/topics/manifest/permission-element.html. The propectionLevel attribute must be declared, telling the system that the application requiring permission notifies the user, or allows who believes that permission is obtained. permissionGroup is optional, and it is related to <permission-group> is used together. label, name, and icon are used to describe permissions. The usage of <permission> will be analyzed in detail later.

<uses-permission> is the most commonly used, and the official document defines it as follows:

<uses-permission android:name="string" />

For example, the definition of SMS and phone permissions:

<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.SEND_SMS"/>

The following are the collected <uses-The information of permission is convenient to find when used:

android.permission.ACCESS_CHECKIN_PROPERTIES
Allow read and write access to the 'properties' table in the checkin database, so that the values can be modified and uploaded/write access to the 'properties' table in the checkin database, to change values that get uploaded)

android.permission.ACCESS_COARSE_LOCATION
Allows an application to access coarse (e.g., Cell ID) location-ID, WiFi) location

android.permission.ACCESS_FINE_LOCATION
Allows an application to access fine (e.g., GPS) location

android.permission.ACCESS_LOCATION_EXTRA_COMMANDS
Allows an application to access extra location provider commands

android.permission.ACCESS_MOCK_LOCATION
Allows an application to create mock location providers for testing

android.permission.ACCESS_NETWORK_STATE
Allows applications to access information about networks

android.permission.ACCESS_SURFACE_FLINGER
Allows an application to use SurfaceFlinger's low level features

android.permission.ACCESS_WIFI_STATE
Allows an application to access Wi-Fi-Allows applications to access information about Wi-Fi network status-Fi networks)

android.permission.ADD_SYSTEM_SERVICE
Allows an application to publish system services-level services).

android.permission.BATTERY_STATS
Allows an application to update the collected battery statistics

android.permission.BLUETOOTH
Allows applications to connect to paired bluetooth devices

android.permission.BLUETOOTH_ADMIN
Allows applications to discover and pair bluetooth devices

android.permission.BRICK
Required to be able to disable the device (very dangerous) *erous!)!)

android.permission.BROADCAST_PACKAGE_REMOVED
Allows an application to broadcast a notification that an application
package has been removed)

android.permission.BROADCAST_STICKY
Allows an application to broadcast sticky intents

android.permission.CALL_PHONE
Allows an application to initiate a phone call without going through the Dialer user interface for the user to confirm the call being placed.

android.permission.CALL_PRIVILEGED
允许一个程序拨打任何号码,包括紧急号码,无需通过拨号用户界面,用户无需确认(Allows an application to call any phone number, including emergency numbers, without going through the Dialer user interface for the user to confirm the call being placed.)

android.permission.CAMERA
请求访问使用照相机设备(Required to be able to access the camera device.)

android.permission.CHANGE_COMPONENT_ENABLED_STATE
允许一个程序是否改变一个组件或其他的启用或禁用(Allows an application to change whether an application component (other than its own) is enabled or not.)

android.permission.CHANGE_CONFIGURATION
允许一个程序修改当前设置,如本地化(Allows an application to modify the current configuration, such as locale.)

android.permission.CHANGE_NETWORK_STATE
允许程序改变网络连接状态(Allows applications to change network connectivity state)

android.permission.CHANGE_WIFI_STATE
允许程序改变Wi-Fi连接状态(Allows an application to change Wi-Fi connectivity state)-允许应用程序更改Wi-Fi连接状态(Allows applications to change Wi-Fi connectivity state)-Fi连接状态(Fi connectivity state)

android.permission.CLEAR_APP_CACHE
允许一个程序清除设备中所有已安装程序的缓存(Allows an application to clear the caches of all installed applications on the device.)

android.permission.CLEAR_APP_USER_DATA
Allows an application to clear user data.

android.permission.CONTROL_LOCATION_UPDATES
Allows enabling or disabling location update notifications from the wireless module./Allows enabling or disabling location update notifications from the radio.

android.permission.DELETE_CACHE_FILES
Allows an application to delete cache files.

android.permission.DELETE_PACKAGES
Allows an application to delete packages.

android.permission.DEVICE_POWER
Allows low-level access to power management.-Low-level access to power management)

android.permission.DIAGNOSTIC
Allows applications to RW to diagnostic resources.

android.permission.DISABLE_KEYGUARD
Allows applications to disable the keyguard.

android.permission.DUMP
Allows an application to retrieve state dump information from system services.

android.permission.EXPAND_STATUS_BAR
Allows an application to expand or collapse the status bar. android development website hints that it should be similar to the tray program in Windows Mobile.

android.permission.FACTORY_TEST
Run as a manufacturer test application, running as the root user.

android.permission.FLASHLIGHT
Allows access to the flashlight, the android development website hints that HTC Dream does not include a flashlight.

android.permission.FORCE_BACK
Allows an application to force a BACK operation on whatever is the top activity.

android.permission.FOTA_UPDATE
It is not yet clear what this is used for, according to the analysis of android development website, it may be a reserved permission.

android.permission.GET_ACCOUNTS
Allows access to the list of accounts in the Accounts Service

android.permission.GET_PACKAGE_SIZE
Allows an application to find out the space used by any package.

android.permission.GET_TASKS
Allows an application to obtain information about the currently or recently running tasks: a thumbnail representation of the tasks, what activities are running in it, etc.

android.permission.HARDWARE_TEST
Allow access to hardware (Allows access to hardware peripherals. )

android.permission.INJECT_EVENTS
Allow a program to capture user events such as keys, touch, trackball, etc., into an event stream, Android development website reminds that it is hook technology (Allows an application to inject user events (keys, touch, trackball) into the event stream and deliver them to ANY window.)

android.permission.INSTALL_PACKAGES
Allow a program to install packages (Allows an application to install packages. )

android.permission.INTERNAL_SYSTEM_WINDOW
Allow windows to be opened using the system user interface (Allows an application to open windows that are for use by parts of the system user interface. )

android.permission.INTERNET
Allow programs to open network sockets (Allows applications to open network sockets)

android.permission.MANAGE_APP_TOKENS
Allow programs to manage (create, destroy, z- order is the default to push along the z-axis) Program references in the window manager (Allows an application to manage (create, destroy, Z-order) application tokens in the window manager. )

android.permission.MASTER_CLEAR
There is no clear explanation yet, Android development website analyzes it may be to clear all data, similar to a hard reset

android.permission.MODIFY_AUDIO_SETTINGS
Allows an application to modify global audio settings

android.permission.MODIFY_PHONE_STATE
Allows modification of the telephony state – power on, mmi, etc.

android.permission.MOUNT_UNMOUNT_FILESYSTEMS
Allows mounting and unmounting file systems for removable storage.

android.permission.PERSISTENT_ACTIVITY
Allow an application to make its activities persistent.

android.permission.PROCESS_OUTGOING_CALLS
Allows an application to monitor, modify, or abort outgoing calls

android.permission.READ_CALENDAR
Allows an application to read the user's calendar data.

android.permission.READ_CONTACTS
Allows an application to read the user's contacts data.

android.permission.READ_FRAME_BUFFER
Allows an application to take screenshots and more generally get access to the framebuffer data

android.permission.READ_INPUT_STATE
Allows an application to retrieve the current state of keys and switches.

android.permission.READ_LOGS
Allows an application to read the low-level system log files.-Level system log files.

android.permission.READ_OWNER_DATA
Allows an application to read the owner's data

android.permission.READ_SMS
Allows an application to read SMS messages.

android.permission.READ_SYNC_SETTINGS
Allows applications to read the sync settings

android.permission.READ_SYNC_STATS
Allows applications to read the sync stats

android.permission.REBOOT
Required to be able to reboot the device.

android.permission.RECEIVE_BOOT_COMPLETED
Allows an application to receive the ACTION_BOOT_COMPLETED that is broadcast after the system finishes booting.

android.permission.RECEIVE_MMS
Allows an application to monitor incoming MMS messages, to record or perform processing on them.

android.permission.RECEIVE_SMS
Allows an application to monitor incoming SMS messages, to record or perform processing on them.

android.permission.RECEIVE_WAP_PUSH
Allows an application to monitor incoming WAP push messages.

android.permission.RECORD_AUDIO
Allows an application to record audio

android.permission.REORDER_TASKS
Allows an application to change the Z-axis arrangement of tasks-order of tasks)

android.permission.RESTART_PACKAGES
Allows an application to restart other applications

android.permission.SEND_SMS
Allows an application to send SMS messages

android.permission.SET_ACTIVITY_WATCHER
Allows an application to watch and control how activities are started globally in the system.

android.permission.SET_ALWAYS_FINISH
Allows an application to control whether activities are immediately finished when put in the background.

android.permission.SET_ANIMATION_SCALE
Modify the global animation scaling factor.

android.permission.SET_DEBUG_APP
Configure an application for debugging.

android.permission.SET_ORIENTATION
Allows low-level access to setting the screen orientation and actual rotation.-Low-level access to setting the orientation (actually rotation) of the screen.

android.permission.SET_PREFERRED_APPLICATIONS
Allows an application to modify the list of preferred applications with the PackageManager.addPackageToPreferred() and PackageManager.removePackageFromPreferred() methods.

android.permission.SET_PROCESS_FOREGROUND
Allows an application to force any currently running process to be in the foreground.

android.permission.SET_PROCESS_LIMIT
Allows an application to set the maximum number of (not needed) application processes that can be running.

android.permission.SET_TIME_ZONE
允许程序设置系统时区(Allows applications to set the system time zone)

android.permission.SET_WALLPAPER
允许程序设置壁纸(Allows applications to set the wallpaper)

android.permission.SET_WALLPAPER_HINTS
允许程序设置壁纸提示(Allows applications to set the wallpaper hints)

android.permission.SIGNAL_PERSISTENT_PROCESSES
允许程序请求发送信号到所有持久进程(Allow an application to request that a signal be sent to all persistent processes)

android.permission.STATUS_BAR
允许程序打开、关闭或禁用状态栏及其图标(Allows an application to open, close, or disable the status bar and its icons.)

android.permission.SUBSCRIBED_FEEDS_READ
允许一个程序允许访问订阅的RSS Feed内容提供者(Allows an application to allow access to the subscribed feeds ContentProvider. )

android.permission.SUBSCRIBED_FEEDS_WRITE
系统暂时保留该设置,android开发网认为未来版本将加入该功能。

android.permission.SYSTEM_ALERT_WINDOW
允许一个程序打开窗口使用TYPE_SYSTEM_ALERT,显示在其他所有程序的顶层(Allows an application to open windows using the type TYPE_SYSTEM_ALERT, shown on top of all other applications. )

android.permission.VIBRATE
Allows access to the vibrator

android.permission.WAKE_LOCK
Allows using PowerManager WakeLocks to keep
from sleeping or screen from dimming)

android.permission.WRITE_APN_SETTINGS
Allows applications to write the apn settings

android.permission.WRITE_CALENDAR
Allows an application to write (but not read) the user's calendar data.

android.permission.WRITE_CONTACTS
Allows an application to write (but not read) the user's contacts data.

android.permission.WRITE_GSERVICES
Allows an application to modify the Google service map.

android.permission.WRITE_OWNER_DATA
Allows an application to write (but not read) the owner's data.

android.permission.WRITE_SETTINGS
Allows an application to read or write the system settings.

android.permission.WRITE_SMS
Allow the program to write SMS (Allows an application to write SMS messages)

android.permission.WRITE_SYNC_SETTINGS
Allow the program to write synchronization settings (Allows applications to write the sync settings)

PS: For the related properties and functions of AndroidManifest.xml file, you can refer to the online tool on this site:

Comprehensive Description of Android Manifest Function and Permission
http://tools.jb51.net/table/AndroidManifest

Readers who are interested in more about Android-related content can check the special topics on this site: 'Android Development入门与进阶教程', 'Android Debugging Skills and Common Problem Solving Methods Summary', 'Android Multimedia Operation Skills Summary (audio, video, recording, etc.)', 'Summary of Android Basic Component Usage', 'Summary of Android View View Skills', 'Summary of Android Layout Layout Skills', and 'Summary of Android Control Usage'

I hope the content described in this article will be helpful to everyone in Android program design.

Statement: The content of this article is from the Internet, and the copyright belongs to the original author. The content is contributed and uploaded by Internet users spontaneously, and this website does not own the copyright, has not been manually edited, and does not assume relevant legal liability. If you find any content suspected of copyright infringement, please send an email to: notice#oldtoolbag.com (When sending an email, please replace # with @ to report, and provide relevant evidence. Once verified, this site will immediately delete the infringing content.)

You May Also Like