AndroidManifest.xml清单文件详解--uses-permission节点

本文详细解析了AndroidManifest.xml中关于uses-permission的各个权限节点,包括访问位置、网络、Wi-Fi状态、电池信息、蓝牙、相机等功能所需的权限。涵盖了从设备状态到网络连接、用户数据清理等多个方面。
摘要由CSDN通过智能技术生成
一、关于节点uses-permission
uses-permission是AndroidManifest.xml中最常用的一项配置,它用来声明一个app在运行时所需要的权限。这里声明的权限在应用安装时会提醒用户,用户可以选择同意安装或拒绝安装。在Android6.0之前,如果用户同意安装,即表示同意app使用在AndroidManifest.xml中声明的所有权限,在Android6.0之后,将应用的权限分成了两类,一类是Normal permissions, 一类是Dangerous permissions。对AndroidManifest.xml中声明的Normal permissions,和之前版本一样,用户同意安装应用就会被授予这些权限。对AndroidManifest.xml中声明的Dangerous permissions,只表示应用需要用到这些权限,用户同意安装并不会自动授予这类权限,当应用运行时用到这些权限时,需要在代码中申请权限,只有用户同意了,才会被授予。用户同意后也可以随时在系统设置中取消对这类权限的授权。


二、uses-permission节点属性
(1)android:name
(2)android:maxSdkVersion


1、android:name属性
需要使用的权限的名字,可以是系统自带的权限,也可以是自定义的权限。Android系统提供了100多个权限。这些权限大多数名字都是以android.permission.为前缀,但也有一小部分是com.android.为前缀,需要注意区分。

下面是收集到的 的资料,方便用的时候查找:

android.permission.ACCESS_CHECKIN_PROPERTIES
允许读写访问”properties”表在checkin数据库中,改值可以修改上传( Allowsread/write access to the “properties” table in the checkin database, to changevalues that get uploaded)

android.permission.ACCESS_COARSE_LOCATION
允许一个程序访问CellID或WiFi热点来获取粗略的位置(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
允许应用程序访问额外的位置提供命令(Allowsan application to access extra location provider commands)

android.permission.ACCESS_MOCK_LOCATION
允许程序创建模拟位置提供用于测试(Allowsan application to create mock location providers for testing)

android.permission.ACCESS_NETWORK_STATE
允许程序访问有关GSM网络信息(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网络状态信息(Allows applications to accessinformation about Wi-Fi networks)

android.permission.ADD_SYSTEM_SERVICE
允许程序发布系统级服务(Allowsan application to publish system-level services).

android.permission.BATTERY_STATS
允许程序更新手机电池统计信息(Allowsan application to update the collected battery statistics)

android.permission.BLUETOOTH
允许程序连接到已配对的蓝牙设备(Allowsapplications to connect to paired bluetooth devices)

android.permission.BLUETOOTH_ADMIN
允许程序发现和配对蓝牙设备(Allowsapplications to discover and pair bluetooth devices)

android.permission.BRICK
请求能够禁用设备(非常危险)(Required to be able to disable thedevice (very *erous!).)

android.permission.BROADCAST_PACKAGE_REMOVED
允许程序广播一个提示消息在一个应用程序包已经移除后(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
允许一个程序初始化一个电话拨号不需通过拨号用户界面需要用户确认(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
允许一个程序拨打任何号码,包含紧急号码无需通过拨号用户界面需要用户确认(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
请求访问使用照相设备(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
允许一个程序修改当前设置,如本地化(Allowsan application to modify the current configuration, such as locale. )

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值