(20120722)(笔记004)android开发应用程序资源
第四章:Android应用程序资源
1.Manifest.permission类:应用程序权限
应用程序权限是Android系统的一大特色,在Android系统中,为提高安全性,系统有必要知道每个应用程序都需要使用哪些资源。因此每个应用程序必须明确地指明本程序应该具有的权限。
(1)什么是应用程序权限
Android应用程序权限明确指明了这个应用程序具备访问哪些资源的能力,需要在应用程序的AndroidManifest.xml文件中指明。
为应用程序指明权限带来的好处便是增强了系统的安全性。该应用程序需要访问的资源一目了然,可以防止某些恶意程序的运行。
① Android应用程序权限:android应用程序权限需要在AndroidManifest.xml文件中声明,这些应用程序权限在Manifest.permission类中提供的。Android系统提供相应的的应用程序权限。
android.permission.ACCESS_CHECKIN_PROPERTIES:
Allowsread/writeaccesstothe“properties”tableinthecheckindatabase,tochangevaluesthatgetuploaded.
允许以read/write访问检入数据库(checkindatabase?)的"properties"表,并且可以更改、更新数据库。
android.permission.ACCESS_COARSE_LOCATION:
Allowsanapplicationtoaccesscoarse(e.g,Cell-ID,WiFi)location.
允许一个应用程序通过访问CellID和WiFi热点等方式获取粗略的本地位置。
android.permission.ACCESS_FINE_LOCATION:
Allowsanapplicationtoaccessfine(e.g,GPS)location.
允许一个应用程序通过访问GPS等方式获取较精确的本地位置。
android.permission.ACCESS_LOCATION_EXTRA_COMMANDS:
Allowsanapplicationtoaccessextralocationprovidercommands.
允许一个应用程序访问(使用)额外的本地位置服务提供者。
android.permission.ACCESS_MOCK_LOCATION:
Allowsanapplicationtoaccessmocklocationprovidersfortesting.
允许一个应用程序访问(创建)模拟的位置服务提供者用于测试。
android.permission.ACCESS_NETWORK_STATE:
Allowsapplicationstoaccessinformationaboutnetworks.
允许应用程序访问(获取)网络信息。
android.permission.ACCESS_SURFACE_FLINGER:
AllowsanapplicationtouseSurfaceFlinger’slowlevelfeatures.
允许一个应用程序使用SurfaceFlinger的底层属性。(什么是SurfaceFlinger?)
android.permission.ACCESS_WIFI_STATE:
AllowsapplicationstoaccessinformationaboutWi-Finetworks.
允许应用程序获取Wi-Fi网络的信息)。
android.permission.ACCOUNT_MANAGER:
AllowsanapplicationstocallintoAccountAuthenticators.
允许一个应用程序启动账户认证。
android.permission.AUTHERTICATE_ACCOUTS:
AllowsanapplicatonstoactasanAccoutAuterticatorfortheAccoutMang
允许一个应用程序充当账户认证管理者。
android.permission.BATTERY_STATS:
Allowsanapplicationtocollectbatterystatistics.
允许一个应用程序获取电池使用的统计信息(剩余电量、电池的耗电情况(各主要应用程序耗电占总耗电的百分比等)等)。
android.permission.BIND_APPWIGET:
AllowsanapplicationtotelltheAppWigetservicewhichapplicationcanaccessAppWigetdata.
允许一个应用程序告知AppWiget服务:我(当前应用程序)可以访问AppWiget数据。
android.permission.BIND_DEVICE_ADMIN:
Mustberequiredbydeviceadministrationreceiver,toensurethatonlythesystemcaninteractwithit.
设备管理服务必须拥有的权限,确保只有系统可以通过设备管理服务与设备进行互动(访问设备,数据交互)。
android.permission.BIND_INPUT_METHOD:
MustberequiredbyanInputMethodService,toensurethatonlythesystemcanbindtoit.
输入法服务(InputMethodService)必须拥有的权限,确保只有系统可以绑定之。
android.permission.BIND_WALLPAPER:
MustberequiredbyaWallpaperService,toensurethatonlythesystemcanbindtoit.
桌面服务(WallpaperService)必须拥有的权限,确保只有系统才可以绑定之.
android.permission.BLUETOOTH:
Allowsapplicationstoconnecttopairedbuletoothdevices.
允许应用程序连接到已配对的蓝牙设备(远端蓝牙,非本机蓝牙)。
android.permission.BULETOOTH_ADMIN:
Allowsapplicationstodiscoveranpairbluetoothdevices.
允许应用程序搜索并且配对蓝牙设备。
android.permission.BRICK:
Requiredtobeabletodisablethedevice(verydangrous!).
禁用设备必须拥有的权限(危险,慎用!)。
android.permission.BROADCAST_PACKAGE_REMOVED:
Allowsanapplicationtoboradcastanotificationthatanapplicationpackagehasbeenremoved.
允许一个应用程序广播“一个(不是同一个)应用程序包已经被移除”的通告。(指一个应用程序已被卸装的通告?)
android.permission.BROADCAST_SMS:
AllowsanapplicationtobroadcastanSMSreceiptnotification.
允许一个应用程序广播一个短信回执(如:帅哥,你有一条新的短消息!)的通告。
android.permission.BROADCAST_STICKY:
Allowsanapplicationtobroadcaststickyintents.
允许一个应用程序广播常用(sticky?)intents.
android.permission.WAP_PUSH:
AllowsanapplicationtobroadcastaWAPPUSHreceiptnotification.
允许一个应用程序广播WAPPUSH回执通告。
说明:WAP-PUSH,WAP推送短信,是一种特殊格式的短信。WAP-PUSH可以将某一站点或某一业务的链接通过短息发送到支持WAP的设备,WAPPUSH实现了短信和WAP业务的结合。
android.permission.CALL_PHONE:
AllowsanapplicationtoinitiateaphonecallwithoutgoingthroughtheDialeruserinterfacefortheusertoconfirmthecallbeingplaced.
允许应用程序不经过用户拨号界面而直接拨号。
android.permission.CALL_PRIVILEGED:
Allowsanapplicationtocallanyphonenumber,includingemergencynumbers,withoutgoingthrougththeDialeruserinterfaceforconfirmthecallbeingpalced.
允许应用程序不经过用户拨号界面而拨打任意号码(包括紧急号码)。(紧急号码是指哪些?)
android.permission.CAMERA:
Requiredtobeabletoaccessthecameradevice.
访问摄像头设备必须具备的权限。
android.permission.CHANGE_COMPONENT_ENABLED_STATE:
Allowsanapplicationtochangewhetheranapplicationcomponent(otherthanitsown)isenabledornot.
允许一个应用程序改变另一个应用程序组件的启用状态(禁用或启用)。
android.permission.CHANGE_NETWORK_STATE:
Allowsapplicationstochangenetworkconnecititystate.
允许应用程序更改网络连接状态。
android.permission.CHANGE_WIFIMULTICAST_STATE:
AllowsapplicationstoenterWi-FiMulticastmode.
允许应用程序进入Wi-FiMulticast模式。
说明:Multicast,多重广播,网络中的一个节点发出的信息被多个节点接收。
android.permission.CHANGE_WIFI_STATE:
AllowsapplicationstochangeWi-Ficonnectivitystate.
允许应用程序更改Wi-Fi连接状态。
android.permission.CLEAR_APP_CACHE:
Allowsanapplicationtoclearthecachesofallinstalledapplicationonthedevice.
允许一个应用程序清理所有已安装程序的设备缓冲区(是安装的时候使用的缓冲区,还是运行时候的缓冲区?)
android.permission.CLEAR_APP_USER_DATA:
Allowsanapplicationtoclearuserdata.
允许一个应用程序清理用户数据。
android.perimmision.CONTROL_LOCATION_UPDATES:
Allowsenabling/disablinglocationupdatenotificationfromtheradio.
允许启用/禁用位置更新的提示信息。(fromtheradio?通过电波获得的位置更新信息?)
android.permission.DELETE_CACHE_FILES:
Allowsanapplicationtodeletecachefiles.
允许一个应用程序删除cache文件。
android.permission.DLEETE.PACKAGES:
Allowsanapplicationtodeletepackages.
允许一个应用程序删除packages(apk安装包?还是所有类型的压缩包?)
android.permission.DEVICE_POWER:
Allowslow-levelaccesstopowermanagement.
允许访问底层的电源管理。
android.permission.DIAGNOSTIC:
AllowsapplicationtoRWtodiagnosticresources.
允许应用程序读写诊断资源(diagnosticresources)。(什么事diagnosticresources?诊断信息,log?)
android.permission.DISABLE_KEYGUARD:
Allowsaplicationstodisablethekeyguard.
允许应程序禁用键盘锁。
android.permission.DUMP:
Allowsanapplicationtoretrievestatedumpinformationfromsystemservices.
允许一个应用程序从系统服务中抓取(检索)状态转储信息。(什么是statedump?将数据从一个设备转存到另外一个设备?)
android.permission.EXPAND_STATUS_BAR:
Allowsanapplicatontoexpandorcollapsethestatusbar.
允许一个应用程序扩张或收缩状态栏。
android.permission.FACTORY_TEST:
Runasanmanufacturertestapplication,runningastherootuser.
允许像厂家测试程序那样以root用户权限运行应用程序。
android.permission.FLSHLIGHT:
Allowsaccesstotheflashlight.
允许访问闪光信号灯。
android.permission.FORCE_BACK:
AllowsanapplicationtoforceaBACKoperationonwhateveristhetopactivity.
允许一个应用程序在activity上强制执行一个回退操作,无论这个activity是否是顶层的activity。
android.permission.GET_ACCOUNTS:
AllowsaccesstothelistofaccoutsintheAccountsService.
允许访问账号服务的账号列表。
android.permission.GET_PACKAGE_SIZE:
Allowsanapplicationtofindoutthespaceusedbyanypackage.
允许应用程序获得任何package占用的存储空间。
android.permission.GET_TASKS:
Allowsanappllicationtogetinformationaboutthecurrentlyorrecentlyrunningtasks:athumbnailrepresentationofthetasks,whatactivitiesarerunninginit,etc.
允许一个应用程序获得的当前或最近运行的任务信息:像在任务中运行了哪些activitys等一些简短信息。
android.permission.GLBOAL_SEARCH:
Thispermissioncanbeusedoncontentproviderstoallowtheglobalsearchsystemtoaccesstheirdata.
拥有该权限的contentproviders将允许全局搜索系统访问其数据。
android.permission.HARDWARE_TEST:
Allowsaccesstohardwareperipherals.
允许访问外设。
android.permission.INJECT_EVENTS:
Allowsanapplicationtoinjectuserevents(keys,touch,trackball)intotheeventstreamanddeliverthemtoANYwindow.
允许一个应用程序向事件流(事件队列)注入用户事件(keys,touch,tarckball),并且将其传递给窗口。
android.permission.INSTALL_LOCATION_PROVIDER:
AllowsanapplicationtoinstallalocatonproviderintthelocationManager.
允许应用程序程序安装一个位置服务到位置管理器。
androd.permission.INSTALL_PCAKAGES:
Allowsanapplicationtoinstallpackages.
允许一个应用程序安装packages。(用于版本升级的?)
android.permission.INTERNAL_SYSTEM_WINDOW:
Allowsanapplicationtoopenwindowsthatareforusebypartsofthesystemuserinterface.
允许一个应用程序打开系统用户界面中的窗口。
android.permission.INTERNET:
Allowsapplicationtoopennetworkdsockets.
允许应用程序打开网络套接字(sockets)
android.permission.KILL_BACKGROUND_PROCESSES:
AllowsanapplicationtocallkillBackgroundProcesses(String).
允许应用程序调用killBackgroundProcesses(String)方法。
android.permission.MANAGE_ACCOUNTS:
AllowsanapplicationtomanagethelistofaccoutsintheAccountManager.
允许应用程序管理AccountManager中的账户列表。
android.permission.MANAGE_APP_TOKENS:
Allowsanapplicationtomanage(create,destroy,Z-order)applicationtokensinthewindowmanager.
允许一个应用程序管理(创建、销毁、Z-order)在窗口管理器中的应用程序图标。
android.permission.MASTER_CLEAR:
none.
没任何描述。
android.permisson.MODIFY_AUDIO_SETTINGS:
Allowsanapplicationtomodifyglobalaudiosettings.
允许一个应用程序更改全局音频设置。
android.permission.MODIFY_PHONE_STATE:
Allowsmodificationofthetelephonystate–poweron,mmi,etc.
允许修改电话(手机?)状态——上电,人机界面(mmi,ManMachineInterface)等。
android.permission.MOUNT_FORMAT_FILESYSTEMS:
Allowsformattingfilesysytemsforremovablestorage.
允许格式化移动存储设备。
android.permission.MOUNT_UNMOUNT_FILESYSYTEMS:
Allowsmountingandunmountingthefilesysytemsforremovablestorage.
允许加载或卸载移动存储设备。
android.permission.FERSISTENT_ACTIVITY:
Allowsanapplicationtomakeitsactivitiespersistent.
允许一个应程序设置其activities具有持久性(persistentactivities是什么样的activites?)。
android.permission.PROCESS_OUTGOING_CALLS:
Allowsanapplicationtomonitor,modify,orabortoutgoingcalls.
允许应用程序监视、修改、忽略拨出的电话(拨号)。
android.permission.READ_CALENDAR:
Allowsanapplicationtoreadtheuser’scalendardata.
允许一个应用程序读取用户日历数据。
android.permission.READ_CONTACTS:
Allowsanapllicationtoreadtheuser’scontactsdata.
允许一个应用程序读取用户联系人列表。
android.permission.READ_FRAME_BUFFER:
Allowsanapplicationtotakescreenshotsandmoregenerallygetaccesstotheframebufferdata.
允许一个应用程序通过访问帧缓冲区(一般一屏就是一帧)获取屏幕截图等帧数据。
更多相关文章
- (转帖)Android开发者应该如何推广营销自己的应用程序
- 《ZigBee开发笔记》第六部分 项目篇 基于ZigBee和Openwrt的智能
- Android 悬浮窗权限各机型各系统适配大全(总结)
- android系统核心机制 基础(09)Android 添加新模块
- exp:Android Studio调试系统源码的方法 (干货分享)
- android 常用调用系统功能
- Android app获取android.permission.BATTERY_STATS权限
- Android应用程序线程消息循环模型分析(4)
- Android 应用程序主动请求Vsync