android怎么在androidmanifest.xml文件中注册权限

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了android怎么在androidmanifest.xml文件中注册权限相关的知识,希望对你有一定的参考价值。

android在androidmanifest.xml文件中注册权限的方法如下
1、程序执行需要读取到安全敏感项必需在androidmanifest.xml中声明相关权限请求, 完整列表如下:
android.permission.ACCESS_CHECKIN_PROPERTIES
允许读写访问”properties”表在checkin数据库中,改值可以修改上传( Allows read/write access to the “properties” table in the checkin database, to change values that get uploaded)

android.permission.ACCESS_COARSE_LOCATION
允许一个程序访问CellID或WiFi热点来获取粗略的位置(Allows an application to access coarse (e.g., Cell-ID, WiFi) location)

android.permission.ACCESS_FINE_LOCATION
允许一个程序访问精良位置(如GPS) (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
允许程序访问有关GSM网络信息(Allows applications to access information about networks)

android.permission.ACCESS_SURFACE_FLINGER
允许程序使用SurfaceFlinger底层特性(Allows an application to use SurfaceFlinger’s low level features)

android.permission.ACCESS_WIFI_STATE
允许程序访问Wi-Fi网络状态信息(Allows applications to access information about Wi-Fi networks)

android.permission.ADD_SYSTEM_SERVICE
允许程序发布系统级服务(Allows an application to publish system-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 *erous!).)

android.permission.BROADCAST_PACKAGE_REMOVED
允许程序广播一个提示消息在一个应用程序包已经移除后(Allows an application to broadcast a notification that an application package has been removed)

android.permission.BROADCAST_STICKY
允许一个程序广播常用intents(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 applications to change Wi-Fi connectivity state)

android.permission.REORDER_TASKS
允许程序改变Z轴排列任务(Allows an application to change the Z-order of tasks)

android.permission.RESTART_PACKAGES
允许程序重新启动其他程序(Allows an application to restart other applications)

android.permission.SEND_SMS
允许程序发送SMS短信(Allows an application to send SMS messages)

android.permission.SET_ACTIVITY_WATCHER
允许程序监控或控制activities已经启动全局系统中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 orientation (actually rotation) of the screen.)

android.permission.SET_PREFERRED_APPLICATIONS
允许一个程序修改列表参数PackageManager.addPackageToPreferred() 和PackageManager.removePackageFromPreferred()方法(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
允许程序设置壁纸hits(Allows applications to set the wallpaper hints)

android.permission.WRITE_SETTINGS
允许程序读取或写入系统设置(Allows an application to read or write the system settings. )

android.permission.WRITE_SMS
允许程序写短信(Allows an application to write SMS messages)

android.permission.WRITE_SYNC_SETTINGS
允许程序写入同步设置(Allows applications to write the sync settings)

2、android平台上的权限许可分得很细,如果软件无法正常执行时看看是不是缺少相关的permission声明,最终还需要使用 android sign tools签名生成的apk文件。
参考技术A <uses-permission android:name="android.permission.INTERNET"/>
使用这种方法,只需要将后面的INTERNET替换成你想要的那个权限就可以了
参考技术B <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />就这样的形式直接写在
androidmanifest.xml
文件中就行。不知道是不是您想要的答案。

以上是关于android怎么在androidmanifest.xml文件中注册权限的主要内容,如果未能解决你的问题,请参考以下文章

android 怎么读取在androidmanifest.xml中配置xml文件

android中怎么在AndroidManifest.xml文件中配置Service

Android中用ANT打包如何将内容复制到AndroidManifest文件中

android开发怎么更改一个完成的app包名

androidmanifest.xml 怎么改

SourceTree提交AndroidManifest.xml文件