Android rights Operation Uses-permission detailed _android

Source: Internet
Author: User
Tags reserved system log delete cache

This example describes the uses-permission of the Android permissions operation. Share to everyone for your reference, specific as follows:

When we install the Android software, the system prompts the software for the permissions it needs, and Android has a lot of permissions relative to other systems. We are in the development of software, also need to declare the appropriate permissions, such as the hope that the software can send text messages, you need to declare the software to call the right to SMS, otherwise the software will run when the error.

The Android permissions are configured in the Androidmanifest.xml file. The Androidmanifest file has four labels related to permission, respectively <permission>, <permission-group>, <permission-tree> and <uses-permission>. One of the most common is <uses-permission>, which must be declared <uses-permission> in our manifest file when we need to get a permission.

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

The role of <permission> and <uses-permission> is similar, the difference between the two,<uses-permission> is the Android predefined permissions, <permission > is a permission that you define. <permission> with relatively few,<permission-group> <permission-tree> these two labels are even rarer, simply say <permission-group> is to declare a label that represents a set of permissions, while <permission-tree> declares a namespace for a group of permissions. The following three labels specific use method subsequent articles will be introduced.

The <permission> definition method is 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 code above comes from the official document: Http://developer.android.com/guide/topics/manifest/permission-element.html. Propectionlevel This attribute must be declared, telling the system to notify the user of the application request permission, or allow the person who considers the license to be granted. Permissiongroup This is optional and is used in conjunction with <permission-group>. Label, name, and icon are used to describe permissions. The use of <permission> will be analyzed in detail later.

<uses-permission> is the most we use, the official document definition way is as follows:

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

For example, the definition of SMS and telephone permissions:

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

The following is a collection of <uses-permission> information to facilitate the use of the time to find:

Android.permission.ACCESS_CHECKIN_PROPERTIES
allow read and write access the "Properties" table in the Checkin database, the value can be modified to upload (Allowsread/write access to the "Properties" table in the Checkin db , to Changevalues-get uploaded)

Android.permission.ACCESS_COARSE_LOCATION
allows a program to access Cellid or WiFi hotspots to get a rough location (Allowsan application to access coarse (e.g., Cell-id, WiFi) location)

Android.permission.ACCESS_FINE_LOCATION
allows a program to access sophisticated locations (such as GPS) (allows an application to accessfine (e.g., GPS) location)

Android.permission.ACCESS_LOCATION_EXTRA_COMMANDS
allows applications to access additional location supply commands (Allowsan application to access extra location provider commands)

Android.permission.ACCESS_MOCK_LOCATION
allows programs to create mock locations for testing (Allowsan application to create mocks location providers for testing)

Android.permission.ACCESS_NETWORK_STATE
allow programs to access information about GSM network (allows applications to accessinformation about networks)

Android.permission.ACCESS_SURFACE_FLINGER
allows programs to use the Surfaceflinger underlying features (allows an application to Usesurfaceflinger's low level features)

Android.permission.ACCESS_WIFI_STATE
allow programs to access Wi-Fi network status information (allows applications to accessinformation about Wi-Fi networks)

Android.permission.ADD_SYSTEM_SERVICE
allows programs to publish system-level services (Allowsan application to publish System-level service).

Android.permission.BATTERY_STATS
allow the program to update cell phone battery statistics (Allowsan application to update the collected battery statistics)

Android.permission.BLUETOOTH
allow programs to connect to paired Bluetooth devices (Allowsapplications to connect to paired Bluetooth devices)

Android.permission.BLUETOOTH_ADMIN
allow programs to discover and pair Bluetooth devices (Allowsapplications to discover and pair Bluetooth devices)

Android.permission.BRICK
the request can disable the device (very dangerous) (Required to is able to disable Thedevice (very *erous!).)

Android.permission.BROADCAST_PACKAGE_REMOVED
allows a program to broadcast a prompt message after an application package has been removed (Allowsan application to broadcast a notification this application
Package has been removed)

Android.permission.BROADCAST_STICKY
allow a program to broadcast common intents (Allowsan application to broadcast sticky intents)

Android.permission.CALL_PHONE
allows a program to initialize a phone call without user confirmation via the Dial-up user interface (Allowsan application to initiate a phone calls without going through the Dialer Userin Terface for the "user to confirm" call being placed.)

Android.permission.CALL_PRIVILEGED
allows a program to dial any number, including an emergency number, without requiring user confirmation via the Dial-up user interface (Allowsan application to calls any phone numbers, including emergency numbers, Withoutgoing through the Dialer user interface for the "user to confirm" call beingplaced)

Android.permission.CAMERA
request access to use a photographic device (Requiredto be able to access the camera device.)

Android.permission.CHANGE_COMPONENT_ENABLED_STATE
allows a program to alter whether one component or another is enabled or disabled (Allowsan application to change whether a application component (other than's own) is enable D or not. )

Android.permission.CHANGE_CONFIGURATION
allows a program to modify the current settings, such as localization (Allowsan application to modify the present configuration, such as locale.)

Android.permission.CHANGE_NETWORK_STATE
allows programs to alter network connection status (allowsapplications to change network connectivity State)

Android.permission.CHANGE_WIFI_STATE
allows the program to alter the Wi-Fi connection status (allows applications to changes wi-ficonnectivity state)

Android.permission.CLEAR_APP_CACHE
allows a program to be clearly cached from all installed programs in the device (Allowsan application to clear the caches of all installed applications on the device.)

Android.permission.CLEAR_APP_USER_DATA
allow a program to purge user settings (Allowsan application to clear users data)

Android.permission.CONTROL_LOCATION_UPDATES
allows the Disable location update prompt to be enabled from the Wireless module (allowsenabling/disabling location update notifications from the radio.)

Android.permission.DELETE_CACHE_FILES
Allow program to delete cached files (Allowsan application to delete cache file)

Android.permission.DELETE_PACKAGES
allow a program to delete a package (Allowsan application to delete packages)

Android.permission.DEVICE_POWER
allow access to the underlying power management (Allowslow-level access to management)

Android.permission.DIAGNOSTIC
allows the program to RW diagnostic resources (allows applications to RW to diagnosticresources.)

Android.permission.DISABLE_KEYGUARD
Allow programs to disable keyboard locks (allowsapplications to disable the Keyguard)

Android.permission.DUMP
allows the program to return state crawl information from the system service (Allowsan application to retrieve the states dump information the from System services.)

Android.permission.EXPAND_STATUS_BAR
allows a program extension to shrink in the status bar, the Android development network hint should be a similar tray program in Windows Mobile (allows an application to expand Orcollapse the status bar.)

Android.permission.FACTORY_TEST
as a factory test program, run at root (run as a manufacturer test application,running as the root user.)

Android.permission.FLASHLIGHT
access Flash, Android development network tips HTC Dream does not contain Flash (allowsaccess to the flashlight)

Android.permission.FORCE_BACK
allows a program to force a back operation whether it is in the top-level activities (Allowsan application to force a behind operation on whatever are the top activity.)

Android.permission.FOTA_UPDATE
for the time being don't understand what this is doing with the Android Development Network analysis may be a reserved privilege.

Android.permission.GET_ACCOUNTS
access to an account list in Accountsservice (allows access to thelist of accounts in the accounts Service)

Android.permission.GET_PACKAGE_SIZE
allows a program to acquire any package footprint (allows an application to find out thespace used by any package.)

Android.permission.GET_TASKS
allows a program to obtain information about current or recently run tasks, an abbreviated task status, activity, etc. (Allowsan application to get information about the currently or recently Runningtasks:a thumbnail representation of the tasks, what activities are running init, etc.)

Android.permission.HARDWARE_TEST
Allow access to hardware (allowsaccess to hardware peripherals.)

Android.permission.INJECT_EVENTS
allow a program to intercept user events such as keystrokes, touches, trackball, etc. wait until a time stream, the Android Development network to remind the Hook technology (Allowsan application to inject user events (keys, touching, trackball) into the EventStream and deliver them to any window.)

Android.permission.INSTALL_PACKAGES
allows one program to install packages (Allowsan application to install packages.)

Android.permission.INTERNAL_SYSTEM_WINDOW
allows Windows to be opened using the System user interface (Allowsan application to open windows so are.

Android.permission.INTERNET
allow programs to open network sockets (allowsapplications to open network sockets)

Android.permission.MANAGE_APP_TOKENS
Allow program management (create, push, z-order default to Z-axis) program references in Window Manager (Allowsan application to manage (created, destroy, Z-order) application Tokens in Thewindow Manager. )

Android.permission.MASTER_CLEAR
There is no clear explanation, the Android Development network analysis may be the removal of all data, similar to the hard lattice machine

Android.permission.MODIFY_AUDIO_SETTINGS
allows programs to modify global audio settings (Allowsan application to modify global audio settings)

Android.permission.MODIFY_PHONE_STATE
allow modification of phone status, such as power supply, human-machine interface, etc. (Allowsmodification of the telephony state–power on, MMI, etc.)

Android.permission.MOUNT_UNMOUNT_FILESYSTEMS
allows mounting and anti-mount file system Removable Storage (allowsmounting and unmounting file systems for Removable Storage.)

Android.permission.PERSISTENT_ACTIVITY
allows a program to set his activities display (Allow an application to make itsactivities persistent.)

Android.permission.PROCESS_OUTGOING_CALLS
allows programs to monitor and modify related broadcast calls (Allowsan application to monitor, modify, or abort outgoing calls)

Android.permission.READ_CALENDAR
allows the program to read the user's calendar data (Allowsan application to read the "Calendar".)

Android.permission.READ_CONTACTS
allows the program to read the user's contact data (Allowsan application to read the "Contacts data.")

Android.permission.READ_FRAME_BUFFER
allows program screen waves or more regular access to frame buffer data (Allowsan application to take screens shots and more generally get access to the Framebuffer )

Android.permission.READ_INPUT_STATE
allows the program to return the current key status (Allowsan application to retrieve the present state of keys and switches.)

Android.permission.READ_LOGS
allows the program to read the underlying system log file (Allowsan application to read the low-level system log files.)

Android.permission.READ_OWNER_DATA
allow program to read owner data (Allowsan application to read the owner)

Android.permission.READ_SMS
allows the program to read short messages (Allowsan application to read SMS messages.)

Android.permission.READ_SYNC_SETTINGS
Allow program read sync settings (allowsapplications to read the sync setting)

Android.permission.READ_SYNC_STATS
allows the program to read the Sync state (allowsapplications to read the sync stats)

Android.permission.REBOOT
the request can reboot the device (Requiredto is able to reboot the device.)

Android.permission.RECEIVE_BOOT_COMPLETED
allows a program to receive action_boot_completed broadcasts at System completion (Allowsan application to receive the action_boot_completed this is Broadcast after Thesystem finishes booting. )

Android.permission.RECEIVE_MMS
allow a program monitor to receive MMS MMS, record or process (Allowsan application to monitor incoming MMS messages, to records or performprocessing on them. )

Android.permission.RECEIVE_SMS
allows a program to monitor a message that will be received, recorded or processed (Allowsan application to monitor incoming SMS messages, to the record or performprocessing on them.)

Android.permission.RECEIVE_WAP_PUSH
allows program monitoring to receive Wappush information (allows an applicationto monitor incoming WAP push messages.)

Android.permission.RECORD_AUDIO
Allow program recording audio (Allowsan application to record audio)

Android.permission.REORDER_TASKS
allows the program to alter the z-axis arrangement task (allows an application to change thez-order of tasks)

Android.permission.RESTART_PACKAGES
allow programs to restart other programs (Allowsan application to restart others applications)

Android.permission.SEND_SMS
allow the program to send SMS messages (allows an application to send smsmessages)

Android.permission.SET_ACTIVITY_WATCHER
allows the program to monitor or control activities has already started the Global system (allows an application to watch Andcontrol How-activities are started globally in the SYS Tem.)

Android.permission.SET_ALWAYS_FINISH
allows program control whether activity is done indirectly when in the background (Allowsan application to control whether activities are immediately when Putin the finished Round.)

Android.permission.SET_ANIMATION_SCALE
Modify Global information scale (Modifythe Global animation scaling factor.)

Android.permission.SET_DEBUG_APP
Configure a program for debugging (Configurean application for debugging.)

Android.permission.SET_ORIENTATION
allows the underlying access to set the screen orientation and actual rotation (Allowslow-level access to setting the orientation (actually rotation) of the.)

Android.permission.SET_PREFERRED_APPLICATIONS
allows a program to modify list parameters packagemanager.addpackagetopreferred () and Packagemanager.removepackagefrompreferred () methods (Allowsan Application to modify the list of preferred applications with thepackagemanager.addpackagetopreferred () Andpackagemanager.removepackagefrompreferred () methods.)

Android.permission.SET_PROCESS_FOREGROUND
allows the program to currently run a program to force to the foreground (Allowsan application to force any currently running process to being in the foreground.)

Android.permission.SET_PROCESS_LIMIT
allows you to set the maximum number of running processes (Allowsan application to set the maximum amount of (not needed) application Processesthat can be running . )

Android.permission.SET_TIME_ZONE
allows the program to set a time zone (allowsapplications to set the system times zone)

Android.permission.SET_WALLPAPER
Allow program settings wallpaper (allowsapplications to set the wallpaper)

Android.permission.SET_WALLPAPER_HINTS
allows program settings wallpaper hits (allowsapplications to set the wallpaper hints)

Android.permission.SIGNAL_PERSISTENT_PROCESSES
allows a program to request a signal to send to all displayed processes (Allowan application to request, that a signal is sent to all persistent processes)

Android.permission.STATUS_BAR
allows programs to turn on, close, or disable status bars and icons Allowsan application to open, closed, or disable the status bar and its icons.

Android.permission.SUBSCRIBED_FEEDS_READ
allows one program to access subscription RssFeed content offers (allows an applicationto allow access the subscribed feeds.)

Android.permission.SUBSCRIBED_FEEDS_WRITE
the system is temporarily reserved for change, and the Android Development Network believes future versions will be added to this feature.

Android.permission.SYSTEM_ALERT_WINDOW
allows a program to open windows using Type_system_alert, displayed at the top of all other programs (Allowsan application to open windows using the type Type_system_alert, Shown on TOPOF all other applications. )

Android.permission.VIBRATE
allow access to vibrating devices (allowsaccess to the vibrator)

Android.permission.WAKE_LOCK
allow PowerManager wakelocks to keep the process from disappearing from the screen during hibernation (allows using PowerManager wakelocks to keep
Processor from sleeping or screen fromdimming)

Android.permission.WRITE_APN_SETTINGS
allow programs to write API settings (allows applications to write the apnsettings)

Android.permission.WRITE_CALENDAR
allows a program to write without reading the user's calendar data (Allowsan application to write (but not read).

Android.permission.WRITE_CONTACTS
allows the program to write without reading the user's contact data (Allowsan application to write (but not read), Contacts data.)

Android.permission.WRITE_GSERVICES
allows the program to modify Google service maps (allows an application to modify Thegoogle service map.)

Android.permission.WRITE_OWNER_DATA
allows a program to write without reading the owner data (Allowsan application to write (but not read).

Android.permission.WRITE_SETTINGS
allows the program to read or write system settings (Allowsan application to read or write).

Android.permission.WRITE_SMS
allow programs to write text messages (Allowsan application to write SMS messages)

Android.permission.WRITE_SYNC_SETTINGS
Allow program write sync settings (allowsapplications to write the sync setting)

PS: About Androidmanifest.xml file related properties can refer to the site online tools:

Android manifest Features and Permissions description Encyclopedia:
Http://tools.jb51.net/table/AndroidManifest

For more information on Android-related content readers can view the site topics: "Android Development Introduction and Advanced Course", "Android debugging techniques and common problems solution summary", "Android Multimedia operating skills Summary (audio, video, recording, etc.)", " Android Basic Components Usage Summary, Android View tips Summary, Android layout layout tips and Android Control usage summary

I hope this article will help you with the Android program.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.