国产激情自拍_国产9色视频_丁香花在线电影小说观看 _久久久久国产精品嫩草影院

首頁 > 系統(tǒng) > Android > 正文

Android權(quán)限操作之uses-permission詳解

2019-10-23 20:08:52
字體:
供稿:網(wǎng)友

本文實(shí)例講述了Android權(quán)限操作之uses-permission。分享給大家供大家參考,具體如下:

我們在安裝Android軟件的時候,系統(tǒng)會提示該軟件所需要的權(quán)限,相對于其他系統(tǒng),android的權(quán)限非常多。我們在開發(fā)軟件的時候,也需要聲明相應(yīng)的權(quán)限,比如希望軟件能發(fā)短信,需要聲明軟件調(diào)用短信的權(quán)限,否則軟件運(yùn)行的時候就會報錯。

Android的權(quán)限在AndroidManifest.xml文件里配置。AndroidManifest文件中有四個標(biāo)簽與permission有關(guān),它們分別是 <permission>、 <permission-group> 、<permission-tree> 和 <uses-permission>。其中最常用的是 <uses-permission>,當(dāng)我們需要獲取某個權(quán)限的時候就必須在我們的manifest文件中聲明<uses-permission>。

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

<permission>和 <uses-permission>的作用相似,兩者之間的不同之處,<uses-permission>是android預(yù)定義的權(quán)限,<permission>是自己定義的權(quán)限。 <permission>用的相對較少,<permission-group>   <permission-tree>這兩個標(biāo)簽就更少見了,簡單說<permission-group> 就是聲明一個標(biāo)簽,該標(biāo)簽代表了一組permissions,而<permission-tree>是為一組permissions聲明了一個namespace。后面三個標(biāo)簽具體使用方法后續(xù)文章會有介紹。

<permission>定義方法如下:

<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"] />

上面代碼來自官方文檔:http://developer.android.com/guide/topics/manifest/permission-element.html。propectionLevel這個屬性是必須聲明,告訴系統(tǒng)通知用戶的應(yīng)用要求許可,或允許誰認(rèn)為獲得許可的情況下。permissionGroup這個是可選的,與<permission-group>配合使用。label, name和icon用于描述權(quán)限。 <permission>的用法后面也會再詳細(xì)分析。

<uses-permission>是我們用的最多的,官方文檔定義方式如下:

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

例如,短信和電話權(quán)限的定義:

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

下面是收集到的 <uses-permission>的資料,方便用的時候查找:

android.permission.ACCESS_CHECKIN_PROPERTIES
允許讀寫訪問”properties”表在checkin數(shù)據(jù)庫中,改值可以修改上傳( Allowsread/write access to the “properties” table in the checkin database, to changevalues that get uploaded)

android.permission.ACCESS_COARSE_LOCATION
允許一個程序訪問CellID或WiFi熱點(diǎn)來獲取粗略的位置(Allowsan application to access coarse (e.g., Cell-ID, WiFi) location)

android.permission.ACCESS_FINE_LOCATION
允許一個程序訪問精良位置(如GPS) (Allows an application to accessfine (e.g., GPS) location)

android.permission.ACCESS_LOCATION_EXTRA_COMMANDS
允許應(yīng)用程序訪問額外的位置提供命令(Allowsan application to access extra location provider commands)

android.permission.ACCESS_MOCK_LOCATION
允許程序創(chuàng)建模擬位置提供用于測試(Allowsan application to create mock location providers for testing)

android.permission.ACCESS_NETWORK_STATE
允許程序訪問有關(guān)GSM網(wǎng)絡(luò)信息(Allows applications to accessinformation about networks)

android.permission.ACCESS_SURFACE_FLINGER
允許程序使用SurfaceFlinger底層特性(Allows an application to useSurfaceFlinger's low level features)

android.permission.ACCESS_WIFI_STATE
允許程序訪問Wi-Fi網(wǎng)絡(luò)狀態(tài)信息(Allows applications to accessinformation about Wi-Fi networks)

android.permission.ADD_SYSTEM_SERVICE
允許程序發(fā)布系統(tǒng)級服務(wù)(Allowsan application to publish system-level services).

android.permission.BATTERY_STATS
允許程序更新手機(jī)電池統(tǒng)計信息(Allowsan application to update the collected battery statistics)

android.permission.BLUETOOTH
允許程序連接到已配對的藍(lán)牙設(shè)備(Allowsapplications to connect to paired bluetooth devices)

android.permission.BLUETOOTH_ADMIN
允許程序發(fā)現(xiàn)和配對藍(lán)牙設(shè)備(Allowsapplications to discover and pair bluetooth devices)

android.permission.BRICK
請求能夠禁用設(shè)備(非常危險)(Required to be able to disable thedevice (very *erous!).)

android.permission.BROADCAST_PACKAGE_REMOVED
允許程序廣播一個提示消息在一個應(yīng)用程序包已經(jīng)移除后(Allowsan application to broadcast a notification that an application
package has been removed)

android.permission.BROADCAST_STICKY
允許一個程序廣播常用intents(Allowsan application to broadcast sticky intents)

android.permission.CALL_PHONE
允許一個程序初始化一個電話撥號不需通過撥號用戶界面需要用戶確認(rèn)(Allowsan application to initiate a phone call without going through the Dialer userinterface for the user to confirm the call being placed.)

android.permission.CALL_PRIVILEGED
允許一個程序撥打任何號碼,包含緊急號碼無需通過撥號用戶界面需要用戶確認(rèn)(Allowsan application to call any phone number, including emergency numbers, withoutgoing through the Dialer user interface for the user to confirm the call beingplaced)

android.permission.CAMERA
請求訪問使用照相設(shè)備(Requiredto be able to access the camera device. )

android.permission.CHANGE_COMPONENT_ENABLED_STATE
允許一個程序是否改變一個組件或其他的啟用或禁用(Allowsan application to change whether an application component (other than its own)is enabled or not. )

android.permission.CHANGE_CONFIGURATION
允許一個程序修改當(dāng)前設(shè)置,如本地化(Allowsan application to modify the current configuration, such as locale. )

android.permission.CHANGE_NETWORK_STATE
允許程序改變網(wǎng)絡(luò)連接狀態(tài)(Allowsapplications to change network connectivity state)

android.permission.CHANGE_WIFI_STATE
允許程序改變Wi-Fi連接狀態(tài)(Allows applications to change Wi-Ficonnectivity state)

android.permission.CLEAR_APP_CACHE
允許一個程序清楚緩存從所有安裝的程序在設(shè)備中(Allowsan application to clear the caches of all installed applications on the device.)

android.permission.CLEAR_APP_USER_DATA
允許一個程序清除用戶設(shè)置(Allowsan application to clear user data)

android.permission.CONTROL_LOCATION_UPDATES
允許啟用禁止位置更新提示從無線模塊(Allowsenabling/disabling location update notifications from the radio. )

android.permission.DELETE_CACHE_FILES
允許程序刪除緩存文件(Allowsan application to delete cache files)

android.permission.DELETE_PACKAGES
允許一個程序刪除包(Allowsan application to delete packages)

android.permission.DEVICE_POWER
允許訪問底層電源管理(Allowslow-level access to power management)

android.permission.DIAGNOSTIC
允許程序RW診斷資源(Allows applications to RW to diagnosticresources. )

android.permission.DISABLE_KEYGUARD
允許程序禁用鍵盤鎖(Allowsapplications to disable the keyguard )

android.permission.DUMP
允許程序返回狀態(tài)抓取信息從系統(tǒng)服務(wù)(Allowsan application to retrieve state dump information from system services.)

android.permission.EXPAND_STATUS_BAR
允許一個程序擴(kuò)展收縮在狀態(tài)欄,android開發(fā)網(wǎng)提示應(yīng)該是一個類似Windows Mobile中的托盤程序(Allows an application to expand orcollapse the status bar. )

android.permission.FACTORY_TEST
作為一個工廠測試程序,運(yùn)行在root用戶(Run as a manufacturer test application,running as the root user. )

android.permission.FLASHLIGHT
訪問閃光燈,android開發(fā)網(wǎng)提示HTC Dream不包含閃光燈(Allowsaccess to the flashlight )

android.permission.FORCE_BACK
允許程序強(qiáng)行一個后退操作是否在頂層activities(Allowsan application to force a BACK operation on whatever is the top activity. )

android.permission.FOTA_UPDATE
暫時不了解這是做什么使用的,android開發(fā)網(wǎng)分析可能是一個預(yù)留權(quán)限.

android.permission.GET_ACCOUNTS
訪問一個帳戶列表在AccountsService中(Allows access to thelist of accounts in the Accounts Service)

android.permission.GET_PACKAGE_SIZE
允許一個程序獲取任何package占用空間容量(Allows an application to find out thespace used by any package. )

android.permission.GET_TASKS
允許一個程序獲取信息有關(guān)當(dāng)前或最近運(yùn)行的任務(wù),一個縮略的任務(wù)狀態(tài),是否活動等等(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
允許訪問硬件(Allowsaccess to hardware peripherals. )

android.permission.INJECT_EVENTS
允許一個程序截獲用戶事件如按鍵、觸摸、軌跡球等等到一個時間流,android開發(fā)網(wǎng)提醒算是hook技術(shù)吧(Allowsan application to inject user events (keys, touch, trackball) into the eventstream and deliver them to ANY window.)

android.permission.INSTALL_PACKAGES
允許一個程序安裝packages(Allowsan application to install packages. )

android.permission.INTERNAL_SYSTEM_WINDOW
允許打開窗口使用系統(tǒng)用戶界面(Allowsan application to open windows that are for use by parts of the system userinterface. )

android.permission.INTERNET
允許程序打開網(wǎng)絡(luò)套接字(Allowsapplications to open network sockets)

android.permission.MANAGE_APP_TOKENS
允許程序管理(創(chuàng)建、催后、 z- order默認(rèn)向z軸推移)程序引用在窗口管理器中(Allowsan application to manage (create, destroy, Z-order) application tokens in thewindow manager. )

android.permission.MASTER_CLEAR
目前還沒有明確的解釋,android開發(fā)網(wǎng)分析可能是清除一切數(shù)據(jù),類似硬格機(jī)

android.permission.MODIFY_AUDIO_SETTINGS
允許程序修改全局音頻設(shè)置(Allowsan application to modify global audio settings)

android.permission.MODIFY_PHONE_STATE
允許修改話機(jī)狀態(tài),如電源,人機(jī)接口等(Allowsmodification of the telephony state – power on, mmi, etc. )

android.permission.MOUNT_UNMOUNT_FILESYSTEMS
允許掛載和反掛載文件系統(tǒng)可移動存儲(Allowsmounting and unmounting file systems for removable storage. )

android.permission.PERSISTENT_ACTIVITY
允許一個程序設(shè)置他的activities顯示(Allow an application to make itsactivities persistent. )

android.permission.PROCESS_OUTGOING_CALLS
允許程序監(jiān)視、修改有關(guān)播出電話(Allowsan application to monitor, modify, or abort outgoing calls)

android.permission.READ_CALENDAR
允許程序讀取用戶日歷數(shù)據(jù)(Allowsan application to read the user's calendar data.)

android.permission.READ_CONTACTS
允許程序讀取用戶聯(lián)系人數(shù)據(jù)(Allowsan application to read the user's contacts data.)

android.permission.READ_FRAME_BUFFER
允許程序屏幕波或和更多常規(guī)的訪問幀緩沖數(shù)據(jù)(Allowsan application to take screen shots and more generally get access to the framebuffer data)

android.permission.READ_INPUT_STATE
允許程序返回當(dāng)前按鍵狀態(tài)(Allowsan application to retrieve the current state of keys and switches. )

android.permission.READ_LOGS
允許程序讀取底層系統(tǒng)日志文件(Allowsan application to read the low-level system log files. )

android.permission.READ_OWNER_DATA
允許程序讀取所有者數(shù)據(jù)(Allowsan application to read the owner's data)

android.permission.READ_SMS
允許程序讀取短信息(Allowsan application to read SMS messages.)

android.permission.READ_SYNC_SETTINGS
允許程序讀取同步設(shè)置(Allowsapplications to read the sync settings)

android.permission.READ_SYNC_STATS
允許程序讀取同步狀態(tài)(Allowsapplications to read the sync stats)

android.permission.REBOOT
請求能夠重新啟動設(shè)備(Requiredto be able to reboot the device. )

android.permission.RECEIVE_BOOT_COMPLETED
允許一個程序接收到ACTION_BOOT_COMPLETED廣播在系統(tǒng)完成啟動(Allowsan application to receive the ACTION_BOOT_COMPLETED that is broadcast after thesystem finishes booting. )

android.permission.RECEIVE_MMS
允許一個程序監(jiān)控將收到MMS彩信,記錄或處理(Allowsan application to monitor incoming MMS messages, to record or performprocessing on them. )

android.permission.RECEIVE_SMS
允許程序監(jiān)控一個將收到短信息,記錄或處理(Allowsan application to monitor incoming SMS messages, to record or performprocessing on them.)

android.permission.RECEIVE_WAP_PUSH
允許程序監(jiān)控將收到WAPPUSH信息(Allows an applicationto monitor incoming WAP push messages. )

android.permission.RECORD_AUDIO
允許程序錄制音頻(Allowsan application to record audio)

android.permission.REORDER_TASKS
允許程序改變Z軸排列任務(wù)(Allows an application to change theZ-order of tasks)

android.permission.RESTART_PACKAGES
允許程序重新啟動其他程序(Allowsan application to restart other applications)

android.permission.SEND_SMS
允許程序發(fā)送SMS短信(Allows an application to send SMSmessages)

android.permission.SET_ACTIVITY_WATCHER
允許程序監(jiān)控或控制activities已經(jīng)啟動全局系統(tǒng)中(Allows an application to watch andcontrol how activities are started globally in the system.)

android.permission.SET_ALWAYS_FINISH
允許程序控制是否活動間接完成在處于后臺時(Allowsan application to control whether activities are immediately finished when putin the background.)

android.permission.SET_ANIMATION_SCALE
修改全局信息比例(Modifythe global animation scaling factor.)

android.permission.SET_DEBUG_APP
配置一個程序用于調(diào)試(Configurean application for debugging.)

android.permission.SET_ORIENTATION
允許底層訪問設(shè)置屏幕方向和實(shí)際旋轉(zhuǎn)(Allowslow-level access to setting the orientation (actually rotation) of the screen.)

android.permission.SET_PREFERRED_APPLICATIONS
允許一個程序修改列表參數(shù)PackageManager.addPackageToPreferred()和PackageManager.removePackageFromPreferred()方法(Allowsan application to modify the list of preferred applications with thePackageManager.addPackageToPreferred() andPackageManager.removePackageFromPreferred() methods.)

android.permission.SET_PROCESS_FOREGROUND
允許程序當(dāng)前運(yùn)行程序強(qiáng)行到前臺(Allowsan application to force any currently running process to be in the foreground.)

android.permission.SET_PROCESS_LIMIT
允許設(shè)置最大的運(yùn)行進(jìn)程數(shù)量(Allowsan application to set the maximum number of (not needed) application processesthat can be running. )

android.permission.SET_TIME_ZONE
允許程序設(shè)置時間區(qū)域(Allowsapplications to set the system time zone)

android.permission.SET_WALLPAPER
允許程序設(shè)置壁紙(Allowsapplications to set the wallpaper )

android.permission.SET_WALLPAPER_HINTS
允許程序設(shè)置壁紙hits(Allowsapplications to set the wallpaper hints)

android.permission.SIGNAL_PERSISTENT_PROCESSES
允許程序請求發(fā)送信號到所有顯示的進(jìn)程中(Allowan application to request that a signal be sent to all persistent processes)

android.permission.STATUS_BAR
允許程序打開、關(guān)閉或禁用狀態(tài)欄及圖標(biāo)Allowsan application to open, close, or disable the status bar and its icons.

android.permission.SUBSCRIBED_FEEDS_READ
允許一個程序訪問訂閱RSSFeed內(nèi)容提供(Allows an applicationto allow access the subscribed feeds ContentProvider. )

android.permission.SUBSCRIBED_FEEDS_WRITE
系統(tǒng)暫時保留改設(shè)置,android開發(fā)網(wǎng)認(rèn)為未來版本會加入該功能。

android.permission.SYSTEM_ALERT_WINDOW
允許一個程序打開窗口使用TYPE_SYSTEM_ALERT,顯示在其他所有程序的頂層(Allowsan application to open windows using the type TYPE_SYSTEM_ALERT, shown on topof all other applications. )

android.permission.VIBRATE
允許訪問振動設(shè)備(Allowsaccess to the vibrator)

android.permission.WAKE_LOCK
允許使用PowerManager的 WakeLocks保持進(jìn)程在休眠時從屏幕消失(Allows using PowerManager WakeLocks to keep
processor from sleeping or screen fromdimming)

android.permission.WRITE_APN_SETTINGS
允許程序?qū)懭階PI設(shè)置(Allows applications to write the apnsettings)

android.permission.WRITE_CALENDAR
允許一個程序?qū)懭氲蛔x取用戶日歷數(shù)據(jù)(Allowsan application to write (but not read) the user's calendar data. )

android.permission.WRITE_CONTACTS
允許程序?qū)懭氲蛔x取用戶聯(lián)系人數(shù)據(jù)(Allowsan application to write (but not read) the user's contacts data. )

android.permission.WRITE_GSERVICES
允許程序修改Google服務(wù)地圖(Allows an application to modify theGoogle service map. )

android.permission.WRITE_OWNER_DATA
允許一個程序?qū)懭氲蛔x取所有者數(shù)據(jù)(Allowsan application to write (but not read) the owner's data.)

android.permission.WRITE_SETTINGS
允許程序讀取或?qū)懭胂到y(tǒng)設(shè)置(Allowsan application to read or write the system settings. )

android.permission.WRITE_SMS
允許程序?qū)懚绦?Allowsan application to write SMS messages)

android.permission.WRITE_SYNC_SETTINGS
允許程序?qū)懭胪皆O(shè)置(Allowsapplications to write the sync settings)

希望本文所述對大家Android程序設(shè)計有所幫助。


注:相關(guān)教程知識閱讀請移步到Android開發(fā)頻道。
發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
国产激情自拍_国产9色视频_丁香花在线电影小说观看 _久久久久国产精品嫩草影院
麻豆精品免费视频入口| a视频免费看| 亚洲视频精品在线观看| 国产高清在线观看| 2019中文字幕在线电影免费| 国产一区二区三区四区尤物| 日韩av成人| 国产精品178页| 精品极品三级久久久久| 欧美黑人乱大交ⅹxxxxx| 久热精品免费视频| 国产一二三区在线| 国产l精品国产亚洲区在线观看| 国产午夜在线视频| 中文av在线播放| www.91在线播放| 国产秒拍福利视频露脸| 国产成人亚洲精品播放器下载| av三级在线观看| 国产男女av| 国产福利图片| 欧美色欧美亚洲另类二区精品| 午夜视频在线观看网站午夜视频在线| 国产区视频在线观看| а√天堂www在线а√天堂视频| 日本卡一卡2卡3卡4精品卡网站| 国产美女在线免费观看| 国产日产精品久久久久久婷婷| www狠狠操| 国产亚av手机在线观看| 在线观看中文字幕| 黄色av电影在线播放| 91视频久色| 国产在线色视频| 亚洲一道本在线| 国产深夜福利| 日本18视频网站| 国产福利免费观看| 国产美女在线一区二区三区| 亚洲国产精品区| 精品国产福利一区二区在线| 国产网站av| 国产一卡二卡3卡4卡四卡在线| 牛牛热在线视频| 青青草视频在线免费观看| 影音先锋日韩| 99re在线视频| 国产高清av| 国产精品理人伦一区二区三区| 久久久久久77777| 天天操夜夜做| 四虎成人免费| www在线视频| 麻豆精品传媒视频观看| 国产精品一区二区三区高清在线| 九九热在线视频免费观看| 超碰国产在线| 高清av在线| 中文字幕视频在线观看| 国产亚洲精品久久久网站好莱| 最近最好的中文字幕2019免费| 中文字幕免费中文| 精品一区二区三区免费站| 亚洲欧美精品中文第三| 欧美激情福利视频在线观看免费| 九九热视频在线观看| 欧美韩日国产| 国产精品久久久久永久免费看| 91这里只有精品| 亚洲一道本在线| 国产在线小视频| 国产不卡在线| 亚洲an天堂an在线观看| 国产九色在线| 在线免费日韩| 二人午夜免费观看在线视频| 91黄色在线| 国产专区在线播放| 精品国产免费观看一区| 高清视频一区二区三区四区| 精品美女在线观看视频在线观看| 在线观看中文字幕| 中文字幕不卡免费视频| 亚洲视频精品在线观看| 国产特级毛片| 久久精品视频观看| 在线免费看黄网站| 国产女主播在线| 九九热在线视频免费观看| 在线观看免费高清完整| 1区2区视频| 九九热在线免费视频| 性网站在线播放| 国产精品久久久久久久牛牛| 高清欧美精品xxxxx在线看| 午夜影院在线| 国产精品xxx电影| 国产一卡二卡3卡4卡四卡在线| 超碰免费在线播放| 波多野结衣久久高清免费| 亚洲视频网站在线| 在线观看中文字幕一区| 一区二区三区免费视频网站| 国产对白国语对白| 国产高清免费在线播放| 国产精品爱久久久久久久小说| 国产欧美日韩专区| 精品国内自产拍在线视频| 精品视频一区二区观看| 国产成人精品18| 国产超碰在线观看| 国产三级自拍| 国产精品爱久久久久久久小说 | 国产视频中文字幕| √天堂8资源中文在线| 国产乱妇乱子在线播视频播放网站| 老鸭窝av在线| 中文字幕国产欧美| 国产黄色免费网站| 亚洲精品自拍区在线观看| 牛牛热在线视频| 午夜视频免费在线观看| 国产激情视频一区二区三区| 在线视频婷婷| 欧美日韩视频精品二区| 超碰免费97在线观看| 最新天堂资源在线资源| 国产一级视频| 18av在线视频| 黄色网址在线免费播放| 国产精品国产国产aⅴ| 日韩不卡高清| 国产视频中文字幕在线观看| av男人的天堂网| 国产卡1卡2卡三卡在线| 中文在线视频| 91超碰国产在线| 在线视频1区2区| 久热精品免费视频| 91欧美在线视频| av中文字幕在线看| 自拍av在线| 狂野欧美性猛交xxxx乱大交| 精品福利影院| 中文字幕国产视频| 热99re久久精品这里都是免费| 国产天堂在线观看| 麻豆精品传媒视频观看| 国产精品第八页| 国产精品作爱| 香蕉视频在线观看网站| 国产不卡视频| 国产日本韩国在线播放| 丁香视频免费观看| 久久精品无码一区二区日韩av | 在线观看免费黄色| 国产国产国产国产国产国产| 日本h视频在线观看| 亚洲精品男人| 四虎www视频| 四虎成年永久免费网站| 亚洲私人影吧| www.操操操.com| eeuss影院在线播放| 四虎成人免费| 美女网站在线观看| 超碰在线国产| 狠狠干婷婷色| 国产毛片在线看| 国产天堂在线观看| 国产极品一区二区三区| 国产综合视频一区二区三区免费| 精品a在线观看| 中文字幕视频在线| 自拍av在线| 国产精品福利视频一区二区三区| 国产色在线观看| 精品视频一二区| 天天干天天摸| 丁香综合五月| 国产福利一区二区在线精品| 国产videos| 91在线超碰| 午夜影院在线免费观看| www在线视频观看| 国产女人在线视频| 国产精品入口麻豆免费看| 96久久久久久| 日本一二区视频| 国产一级二级在线| 91中文字幕| 欧美韩日国产| 精品视频一二区| 超碰国产在线| 91视频久色| 国产美女被遭强高潮免费网站| 国产视频第一区| 亚洲成人电视网| 国产免费一级| 在线播放一区二区精品产|