<uses-feature>

句法

<uses-feature android:name="string" android:required=["true" | "false"] android:glEsVersion="integer" />
包含于

<manifest>

描述:
声明所使用的应用程序的单个硬件或软件功能。
一个<用途特征>声明的目的是通知一套关于您的应用程序依赖硬件和软件功能的任何外部实体。该元素提供了必需的属性,让您指定应用程序是否需要和不申报的功能不能发挥作用,还是更喜欢有特点,但没有它可以发挥作用。由于功能的支持可以在Android设备各不相同,<用途特征>元素餐厅在让应用程序描述它使用的设备变量功能有重要作用。
在一套应用程序中声明将与设定的被Android软件包管理系统提供的功能的常量,这是在这个文件的底部列出了方便的特点参考表中可用的功能。
您必须指定在一个单独的<使用特征>元素的每个特征,因此,如果您的应用需要多种功能,它会声明多个<使用特征>元素。例如,这需要蓝牙和相机功能的装置中的应用程序将声明这两种元素:

uses-feature android:name="android.hardware.bluetooth" /><uses-feature android:name="android.hardware.camera" />
<用途特征>所有的功能元素应用程序需要在一般情况下,你应该始终确保申报。


声明<使用特征>元素仅供参考,这意味着Android系统本身不检查安装应用程序前在设备上的匹配功能的支持。然而,其他服务(如谷歌播放)或应用程序可能会检查你的应用程序的<使用特征>声明作为处理的一部分,或与应用程序交互。出于这个原因,它声明的所有的功能(从下面的列表),您的应用程序使用的是非常重要的。


对于某些功能,有可能存在一个特定的属性,它允许你定义一个版本的功能,如使用的版本的Open GL(有glEsVersion声明)。其他特征,要么或不存在的装置,如照相机,所使用的名称属性声明。


虽然<用途特征>元素仅激活用于运行API级别4或更高的设备,则建议为包括这些元素的所有应用程序,即使的minSdkVersion是“3”或更低。运行旧版平台的设备将完全忽略的元素。


注:当声明一个功能,记住,你还必须要求的权限适当。例如,您还必须请求您的应用程序可以访问摄像头API前摄像头权限。请求权限授予相应的硬件和软件应用程序的访问,同时宣布应用程序所使用的功能,确保正确的设备兼容。


属性:

android:name

指定由应用程序使用的一个单一的硬件或软件的功能,作为一个描述符串。有效的描述符值是在硬件特性列出和软件功能的表,下面。描述字符串值是区分大小写的。

android:required

布尔值,表示该应用程序是否需要在Android中指定的功能:名称。
当你声明的android:所需=“真”的功能,您可以指定应用程序不能功能,或者没有设计功能,当指定的功能不存在的设备上。
当你声明的android:要求=“假”的功能,这意味着应用程序更倾向于如果存在使用该功能的设备上,但它的设计没有指定功能,如果有必要的功能。
为Android的默认值:如果没有声明需要的是“真”。

android:glEsVersion

由应用所需的OpenGL ES版本。高16位代表的主要数和低16位代表次编号。例如,要指定OpenGL ES版本2.0,您将设置值“0x00020000”,或指定的OpenGL ES 3.0,你可以设置值为“0x00030000”。
应用程序应指定最多一个机器人:在其清单glEsVersion属性。如果指定了多个,在android:glEsVersion用最大的数值是用来和任何其他值都被忽略。


如果应用程序没有指定一个机器人:glEsVersion属性,则假定应用程序只需要的OpenGL ES 1.0,这是所有Android设备的支持。


应用程序可以假设,如果一个平台支持一个给定的OpenGL ES版本,它也支持所有数值较低的OpenGL ES版本。因此,既需要的OpenGL ES 1.0和OpenGL ES 2.0的应用程序必须指定它需要的OpenGL ES 2.0。


可以使用任何数的OpenGL ES版本的工作,应用程序应该只指定数值最低的版本的OpenGL ES的,它需要。 (它可以检查在运行时的OpenGL ES更高水​​平是否可用。)


有关使用OpenGL ES的,包括如何在运行时检查支持的OpenGL ES版本的详细信息,请参阅的OpenGL ES API的指南。


介绍了:

谷歌播放和基于特征的过滤


谷歌播放过滤是对用户可见,让用户可以看到并下载只有那些与他们的设备兼容的应用程序的应用程序。它的一个应用程序过滤的方法之一是通过功能兼容性。


以确定与给定的用户的设备中的应用的功能兼容性,谷歌播放比较:


应用程序所需的功能 - 应用程序声明在<用途特征>在其清单的元素特点
与...
可在设备上,在硬件或软件功能 - 设备报​​告,它支持为只读系统属性的功能。
为了确保功能的精确比较,Android的软件包管理器提供了一个共享一套应用程序和设备使用申报功能要求和支持功能常量。可用的功能常量在功能表参照本文件的底部列出,类文档软件包管理系统英寸


当用户启动谷歌播放,应用程序通过调用getSystemAvailableFeatures查询包管理器的设备上可用的功能列表()。该商店的应用程序,然后通过功能列出多达谷歌建立用户会话时播放。


您上传的每个应用程序的谷歌Play开发者控制台时,谷歌播放扫描应用程序的清单文件。它寻找<使用特征>元素,并计算它们与其他元件,在某些情况下,如组合<使用-SDK>和<使用许可权>元素。建立应用程序的集合所需的功能后,内部存储元数据与应用程序.apk文件和应用程序版本的列表。


当用户搜索或浏览了使用谷歌播放应用程序,该服务比较由与用户的设备上可用的功能的每个应用程序所需要的功能。如果所有的应用程序所需的功能存在于设备上,谷歌播放,用户可以查看应用程序和潜在的下载。如果任何需要的功能没有设备支持,谷歌播放过滤应用程序,以便它是不可见的用户,而不是提供下载。


因为你在声明功能<使用特征>元素直接影响谷歌玩就怎么过滤你的应用程序时,了解谷歌玩怎么评估应用程序的清单,并建立集所需的功能是非常重要的。下面的部分提供了更多的信息。


基于过滤上明确宣布特征


显式声明的特点是一个应用程序声明在<用途特征>元素。该功能的声明可以包括机器人:要求=“真”| “假”]属性(如果您正在编译针对API级别5或更高版本),它可以让你指定应用程序是否确实需要此功能,不能没有它正常工作(“真”),或者应用程序是否更愿意使用该功能如果有的话,但被设计为没有它运行(“假”)。


谷歌游戏手柄明确宣布这样的特点:


如果一个功能被显式声明为被要求,谷歌播放添加功能的应用程序所需的功能列表。然后,它过滤掉用户在不提供功能的设备应用程序。例如:

<uses-feature android:name="android.hardware.camera" android:required="true" />
如果不被需要的功能已显式声明,谷歌Play不会将功能添加到所需要的功能列表。出于这个原因,过滤应用程序时显式声明的非必需的功能从来没有考虑过。即使设备不提供声明的功能,谷歌播放仍然会考虑应用程序与设备兼容,并会显示给用户,除非其他过滤规则。 例如:

<uses-feature android:name="android.hardware.camera" android:required="false" />
如果一个功能被显式声明,但没有一个Android:必需的属性,谷歌播放假定功能是必需的,建立在其上的过滤。
一般情况下,如果你的应用程序设计为在Android 1.6和更早的版本中运行,在android:required属性是不是在API中可用的和谷歌播放假定任何和所有的<使用特征>的声明是必需的。


注:通过显式声明功能,并包括一个机器人:要求=“false”属性,可以有效地禁用谷歌所有筛选播放指定的功能。


基于隐过滤功能


隐式的特点是一个应用程序需要以正常工作,但没有宣布在<使用特征>元素中的清单文件。严格来说,每一个应用程序应该总是声明它使用或者要求所有功能,因此没有对应用程序使用功能的声明应被视为一个错误。但是,作为用户和开发者的保障,谷歌播放会在每个应用程序隐含的功能,并设置过滤器这些功能,就像将为显式声明的功能做的。


一个应用程序可能需要的功能,但没有声明是因为:


该应用程序被编译针对较旧版本的Andr​​oid库(Android 1.5的或更早版本)和<使用特征>元素不可用。
开发人员错误地假设,该功能将出现在所有的设备和声明是不必要的。
开发商不小心忽略功能的声明。
显影剂中声明的特征明确地,但声明无效。例如,在<用途特征>元素名称拼写错误,或为Android无法识别的字符串值:name属性会失效功能的声明。
为了说明上述情况,谷歌播放尝试通过检查清单文件中声明的其他元素来发现应用程序的隐含功能需求,特别是<使用许可权>元素。


如果一个应用程序请求硬件相关的权限,谷歌播放假定应用程序使用底层硬件的功能,因此需要这些功能,即使可能没有相应的<使用特征>声明。对于这样的权限,谷歌播放增加了底层硬件的功能,它存储的应用程序,并设置过滤器为他们的元数据。


例如,如果一个应用程序请求摄像头权限,但不声明<用途特征>元素android.hardware.camera,谷歌播放认为,应用程序需要一个摄像头,不应该向用户显示其设备不提供相机。


如果你不希望谷歌播放基于一个特定的暗示特征过滤,可以禁止该行为。要做到这一点,显式声明功能在<使用特征>元素,包括机器人:要求=“false”属性。例如,要禁止从相机导出的权限过滤,你将宣布该功能如下图所示。

<uses-feature android:name="android.hardware.camera" android:required="false" />
要明白,您在<使用许可权>请求权限元素可直接影响谷歌玩就怎么过滤你的应用程序是很重要的。暗示功能要求的参考部分权限,下面,列出了全套暗示功能要求,因此触发过滤权限。


特殊处理的蓝牙功能


谷歌播放应用除上述,确定滤波蓝牙微微时,不同的规则。


如果一个应用程序声明在蓝牙权限的<使用许可权>元素,但没有显式声明的蓝牙功能在<采用特征>元素,谷歌播放检查Android平台的版本(S),其上的应用设计运行,如在<用途-SDK>元素中指定。


如下表所示,谷歌播放启用蓝牙功能的过滤只有当应用程序声明其最低或有针对性的平台的Andr​​oid 2.0(API级别5)或更高。但是,请注意,谷歌播放应用标准规则过滤当应用程序显式声明在<使用特征>元素的蓝牙功能。


表1.谷歌玩就怎么决定请求蓝牙权限,但不声明在<用途特征>元素中的蓝牙功能的应用程序的蓝牙功能要求。

If minSdkVersionis ... or targetSdkVersionis Result
<=4 (or uses-sdk is not declared) <=4 谷歌Play不会过滤来自基于他们对android.hardware.bluetooth报道的功能支持任何设备的应用。
<=4 >=5 谷歌播放过滤掉不支持的功能android.hardware.bluetooth(包括旧版本)的任何设备的应用。
>=5 >=5
下面的例子说明不同的滤波效果,基于谷歌播放如何处理蓝牙功能。


在第一个例子中,被设计为在较旧的API级别上运行应用程序声明蓝牙权限,但不声明在<使用特征>元素的蓝牙功能。
结果:谷歌Play不会过滤来自任何设备的应用程序。

<manifest ...>  <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />  <uses-sdk android:minSdkVersion="3" />  ...</manifest>
在第二个例子,下面,相同的应用程序也宣告“5”的目标API级别。
结果:谷歌Play现在假设该功能是必需的,会过滤所有设备的应用不报蓝牙的支持,包括运行旧版平台的设备。

<manifest ...>  <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />  <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="5" />  ...</manifest>
在这里,同一个应用程序没有特别声明的蓝牙功能。
结果:相同于前面的例子(滤波被施加)。

<manifest ...>  <uses-feature android:name="android.hardware.bluetooth" />  <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />  <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="5" />  ...</manifest>
最后,在下面的情况下,同样的应用程序添加一个机器人:要求=“false”属性。
结果:谷歌播放禁用滤波基于蓝牙功能的支持,对于所有设备。

<manifest ...>  <uses-feature android:name="android.hardware.bluetooth" android:required="false" />  <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />  <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="5" />  ...</manifest>
测试您的应用程序所需的功能


您可以使用AAPT工具,包括在Android SDK,以确定谷歌Play如何筛选应用程序的基础上,它的功能和权限。要做到这一点,使用dump badging命令来运行AAPT。这将导致AAPT解析您的应用程序的清单和13759谷歌播放,以确定您的应用所需的功能适用相同的规则。


要使用该工具,请按照下列步骤操作:


首先,建立和应用程序导出为一个无符号的apk。如果您在Eclipse ADT与发展,右键单击该项目并选择Android的工具>导出未签名的应用程序包。选择目标文件名和路径,然后单击确定。
接下来,找到AAPT工具,如果它是不是已经在你的PATH。如果你正在使用SDK工具R8或更高版本,你可以找到在<SDK> /平台的工具/目录AAPT。
注意:您必须使用提供可用的最新平台的工具组件的AAPT的版本。如果您没有最新的Platform-Tools组件,使用Android SDK管理器中下载。


运行AAPT使用的语法如下:

$ aapt dump badging <path_to_exported_.apk>
Here's an example of the command output for the second Bluetooth example, above:

$ ./aapt dump badging BTExample.apkpackage: name='com.example.android.btexample' versionCode='' versionName=''uses-permission:'android.permission.BLUETOOTH_ADMIN'uses-feature:'android.hardware.bluetooth'sdkVersion:'3'targetSdkVersion:'5'application: label='BT Example' icon='res/drawable/app_bt_ex.png'launchable activity name='com.example.android.btexample.MyActivity'label='' icon=''uses-feature:'android.hardware.touchscreen'mainsupports-screens: 'small' 'normal' 'large'locales: '--_--'densities: '160'
功能参考
下面的表格提供了有关硬件和软件功能,并且可能意味着他们在谷歌播放权限的参考信息。
硬件功能
下表描述了最新的平台发布支持的硬件特征描述。要通知您的应用程序使用或需要一个硬件功能,即在申报一款Android每个值:在一个单独的<使用特征>元素的name属性。

Feature Type Feature Descriptor Description Comments
Audio android.hardware.audio.low_latency The application uses a low-latency audio pipeline on the device and is sensitive to delays or lag in sound input or output.
Bluetooth android.hardware.bluetooth The application uses Bluetooth radio features in the device.
android.hardware.bluetooth_le The application uses Bluetooth Low Energy radio features in the device.
Camera android.hardware.camera The application uses the device's camera. If the device supports multiple cameras, the application uses the camera that facing away from the screen.
android.hardware.camera.autofocus Subfeature. The application uses the device camera's autofocus capability. These subfeatures implicitly declare theandroid.hardware.cameraparent feature, unless declared withandroid:required="false".
android.hardware.camera.flash Subfeature. The application uses the device camera's flash.
android.hardware.camera.front Subfeature. The application uses a front-facing camera on the device.
android.hardware.camera.any The application uses at least one camera facing in any direction, or an external camera device if one is connected. Use this in preference toandroid.hardware.cameraif a back-facing camera is not required.
android.hardware.camera.external The application uses an external camera device if one is connected.
android.hardware.camera.level.full The application uses a camera device withFULL-level support.
android.hardware.camera.capability.manual_sensor The application uses a a camera device with theMANUAL_SENSORcapability.
android.hardware.camera.capability.manual_post_processing The application uses a a camera device with theMANUAL_POST_PROCESSINGcapability.
android.hardware.camera.capability.raw The application uses a a camera device with theRAWcapability.
Infrared android.hardware.consumerir The application uses the consumer IR capabilities on the device.
Location android.hardware.location The application uses one or more features on the device for determining location, such as GPS location, network location, or cell location.
android.hardware.location.network Subfeature. The application uses coarse location coordinates obtained from a network-based geolocation system supported on the device. These subfeatures implicitly declare theandroid.hardware.locationparent feature, unless declared withandroid:required="false".
android.hardware.location.gps Subfeature. The application uses precise location coordinates obtained from a Global Positioning System receiver on the device.
Microphone android.hardware.microphone The application uses a microphone on the device.
NFC android.hardware.nfc The application uses Near Field Communications radio features in the device.
android.hardware.nfc.hce The application uses the NFC card emulation feature in the device.
Sensors android.hardware.sensor.accelerometer The application uses motion readings from an accelerometer on the device.
android.hardware.sensor.barometer The application uses the device's barometer.
android.hardware.sensor.compass The application uses directional readings from a magnetometer (compass) on the device.
android.hardware.sensor.gyroscope The application uses the device's gyroscope sensor.
android.hardware.sensor.light The application uses the device's light sensor.
android.hardware.sensor.proximity The application uses the device's proximity sensor.
android.hardware.sensor.stepcounter The application uses the device's step counter.
android.hardware.sensor.stepdetector The application uses the device's step detector.
Screen android.hardware.screen.landscape The application requires landscape orientation.

For example, if your app requires portrait orientation, you should declare<uses-feature android:name="android.hardware.screen.portrait"/>so that only devices that support portrait orientation (whether always or by user choice) can install your app. If your applicationsupportsboth orientations, then you don't need to declare either.

Both orientations are assumednot required, by default, so your app may be installed on devices that support one or both orientations. However, if any of your activities request that they run in a specific orientation, using theandroid:screenOrientationattribute, then this also declares that the application requires that orientation. For example, if you declareandroid:screenOrientationwith either"landscape","reverseLandscape", or"sensorLandscape", then your application will be available only to devices that support landscape orientation. As a best practice, you should still declare your requirement for this orientation using a<uses-feature>element. If you declare an orientation for your activity usingandroid:screenOrientation, but don't actuallyrequireit, you can disable the requirement by declaring the orientation with a<uses-feature>element and includeandroid:required="false".

For backwards compatibility, any device running a platform version that supports only API level 12 or lower is assumed to support both landscape and portrait.

android.hardware.screen.portrait The application requires portrait orientation.
Telephony android.hardware.telephony The application uses telephony features on the device, such as telephony radio with data communication services.
android.hardware.telephony.cdma Subfeature. The application uses CDMA telephony radio features on the device. These subfeatures implicitly declare theandroid.hardware.telephonyparent feature, unless declared withandroid:required="false".
android.hardware.telephony.gsm Subfeature. The application uses GSM telephony radio features on the device.
Television android.hardware.type.television The application is designed for a television user experience. This feature defines "television" to be a typical living room television experience: displayed on a big screen, where the user is sitting far away and the dominant form of input is something like a d-pad, and generally not through touch or a mouse/pointer-device.
Touchscreen android.hardware.faketouch The application uses basic touch interaction events, such as "click down", "click up", and drag.

When declared as required, this indicates that the application is compatible with a device only if it offers an emulated touchscreen ("fake touch" interface), or better. A device that offers a fake touch interface provides a user input system that emulates a subset of touchscreen capabilities. For example, a mouse or remote control that drives an on-screen cursor provides a fake touch interface. If your application requires basic point and click interaction (in other words, it won't work withonlya d-pad controller), you should declare this feature. Because this is the minimum level of touch interaction, your app will also be compatible with devices that offer more complex touch interfaces.

Note:Because applications require theandroid.hardware.touchscreenfeature by default, if you want your application to be available to devices that provide a fake touch interface, you must also explicitly declare that a touch screen isnotrequired by declaring<uses-feature android:name="android.hardware.touchscreen"android:required="false"/>

android.hardware.faketouch.multitouch.distinct The application performs distinct tracking of two or more "fingers" on a fake touch interface. This is a superset of the faketouch feature.

When declared as required, this indicates that the application is compatible with a device only if it supports touch emulation for events that supports distinct tracking of two or more fingers, or better.

Unlike the distinct multitouch defined byandroid.hardware.touchscreen.multitouch.distinct, input devices that support distinct multi-touch with a fake touch interface will not support all two-finger gestures, because the input is being transformed to cursor movement on the screen. That is, single finger gestures on such a device move a cursor; two-finger swipes will result in single-finger touch events; other two-finger gestures will result in the corresponding two-finger touch event. An example device that supports distinct multi-touch with a fake touch interface is one that provides a trackpad for cursor movement which also supports two or more fingers.

android.hardware.faketouch.multitouch.jazzhand The application performs distinct tracking of five or more "fingers" on a fake touch interface. This is a superset of the faketouch feature.

When declared as required, this indicates that the application is compatible with a device only if it supports touch emulation for events that supports distinct tracking of five or more fingers.

Unlike the distinct multitouch defined byandroid.hardware.touchscreen.multitouch.jazzhand, input devices that support jazzhand multi-touch with a fake touch interface will not support all five-finger gestures, because the input is being transformed to cursor movement on the screen. That is, single finger gestures on such a device move a cursor; multi-finger gestures will result in single-finger touch events; other multi-finger gestures will result in the corresponding multi-finger touch event. An example device that supports distinct multi-touch with a fake touch interface is one that provides a trackpad for cursor movement which also supports five or more fingers.

android.hardware.touchscreen The application uses touchscreen capabilities for gestures that are more interactive than basic touch events, such as a fling. This is a superset of the basic faketouch feature.

By default, your application requires this. As such, your application isnotavailable to devices that provide only an emulated touch interface ("fake touch"), by default. If you want your application available to devices that provide a fake touch interface (or even devices that provide only a d-pad controller), you must explicitly declare that a touch screen is not required, by declaringandroid.hardware.touchscreenwithandroid:required="false". You should do so even if your application uses—but does notrequire—a real touch screen interface.

If your applicationdoes requirea touch interface (in order to perform touch gestures such as a fling), then you don't need to do anything, because this is required by default. However, it's best if you explicitly declare all features used by your application, so you should still declare this if your app uses it.

If you require more complex touch interaction, such as multi-finger gestures, you should declare the advanced touch screen features below.

android.hardware.touchscreen.multitouch The application uses basic two-point multitouch capabilities on the device screen, such as for pinch gestures, but does not need to track touches independently. This is a superset of touchscreen feature. This implicitly declares theandroid.hardware.touchscreenparent feature, unless declared withandroid:required="false".
android.hardware.touchscreen.multitouch.distinct Subfeature. The application uses advanced multipoint multitouch capabilities on the device screen, such as for tracking two or more points fully independently. This is a superset of multitouch feature. This implicitly declares theandroid.hardware.touchscreen.multitouchparent feature, unless declared withandroid:required="false".
android.hardware.touchscreen.multitouch.jazzhand The application uses advanced multipoint multitouch capabilities on the device screen, for tracking up to five points fully independently. This is a superset of distinct multitouch feature.
USB android.hardware.usb.host The application uses USB host mode features (behaves as the host and connects to USB devices).
android.hardware.usb.accessory The application uses USB accessory features (behaves as the USB device and connects to USB hosts).
Wi-Fi android.hardware.wifi The application uses 802.11 networking (Wi-Fi) features on the device.
android.hardware.wifi.direct The application uses the Wi-Fi Direct networking features on the device.

软件功能


下表描述了最新的平台版本所支持的软件功能的描述。要通知您的应用程序使用或需要的软件功能,在申报一款Android每个值:在一个单独的<使用特征>元素的name属性。

Feature Attribute Value Description
App Widgets android.software.app_widgets The application uses or provides App Widgets and should be installed only on devices that include a Home screen or similar location where users can embed App Widgets.
Device Management android.software.device_admin The application uses device policy enforcement via device administrators.
Home Screen android.software.home_screen The application behaves as a Home screen replacement and should be installed only on devices that support third-party Home screen apps.
Input Method android.software.input_methods The application provides a custom input method and should be installed only on devices that support third-party input methods.
Live Wallpaper android.software.live_wallpaper The application uses or provides Live Wallpapers and should be installed only on devices that support Live Wallpapers.
SIP/VOIP android.software.sip The application uses SIP service on the device and should be installed only on devices that support SIP.
android.software.sip.voip

Subfeature. The application uses SIP-based VOIP service on the device.

This subfeature implicitly declares theandroid.software.sipparent feature, unless declared withandroid:required="false".

权限暗示功能要求


上面的表格中列出的某些特征常数,提供给相应的API后,应用;例如,android.hardware.bluetooth功能在Android 2.2的(API级别8)加入,但蓝牙API,它指的是Android 2.0的(API级别5)加入。正因为如此,一些应用程序能够使用的API,他们不得不宣布他们需要通过<用途特征>系统API的能力之前。


为了防止提供无意中这些应用程序,谷歌播放假设某些硬件相关的权限表明,底层硬件的功能默认情况下需要。例如,使用蓝牙应用必须请求在<用途-权限>蓝牙权限元素 - 用于遗留应用,谷歌播放假定许可声明意味着,底层android.hardware.bluetooth特征是由应用所需的,并设置基于特征过滤。


下表列出了暗示功能的要求等同于<用途特征>元素中声明列表的权限。需要注意的是<用途特征>的声明,包括任何声明的android:required属性,始终优先于通过下面的权限暗含的特点。


对于下面的任何权限,您可以通过显式显式声明的隐含功能禁用基于隐含特征过滤,在<使用特征>元素,可与Android:要求=“false”属性。例如,要禁用基于摄像头权限任何过滤,您可将此<用途特征>声明添加到清单文件:

<uses-feature android:name="android.hardware.camera" android:required="false" />
Category This Permission... Implies This Feature Requirement
Bluetooth BLUETOOTH android.hardware.bluetooth

(SeeSpecial handling for Bluetooth featurefor details.)

BLUETOOTH_ADMIN android.hardware.bluetooth
Camera CAMERA android.hardware.cameraand
android.hardware.camera.autofocus
Location ACCESS_MOCK_LOCATION android.hardware.location
ACCESS_LOCATION_EXTRA_COMMANDS android.hardware.location
INSTALL_LOCATION_PROVIDER android.hardware.location
ACCESS_COARSE_LOCATION android.hardware.location.networkand
android.hardware.location
ACCESS_FINE_LOCATION android.hardware.location.gpsand
android.hardware.location
Microphone RECORD_AUDIO android.hardware.microphone
Telephony CALL_PHONE android.hardware.telephony
CALL_PRIVILEGED android.hardware.telephony
MODIFY_PHONE_STATE android.hardware.telephony
PROCESS_OUTGOING_CALLS android.hardware.telephony
READ_SMS android.hardware.telephony
RECEIVE_SMS android.hardware.telephony
RECEIVE_MMS android.hardware.telephony
RECEIVE_WAP_PUSH android.hardware.telephony
SEND_SMS android.hardware.telephony
WRITE_APN_SETTINGS android.hardware.telephony
WRITE_SMS android.hardware.telephony
Wi-Fi ACCESS_WIFI_STATE android.hardware.wifi
CHANGE_WIFI_STATE android.hardware.wifi
CHANGE_WIFI_MULTICAST_STATE android.hardware.wifi





更多相关文章

  1. 在 Android(安卓)上使用 XML 和 JSON,第 2 部分: 交付混合了 JSON
  2. Android(安卓)UI编程之自定义控件初步(上)——ImageButton
  3. Android沉浸式模式实现导航栏与状态栏的隐藏,上滑呼出导航栏与状
  4. Android设计登录界面、找回密码、注册功能
  5. Android全局主题样式控制,语言设置、主题颜色、字体大小、字体样
  6. android 设置头像以及裁剪功能
  7. Android照相功能驱动层中HAL的实现(基于OK6410开发板+OV9650摄像
  8. Android多媒体开发 Pro Android(安卓)Media 第二章 创建自定义相
  9. 集成Android免费语音合成功能(在线、离线、离在线融合),有这一篇文

随机推荐

  1. 21、从头学Android之Android的数据存储--
  2. Android NDK开发之Jni的数据类型
  3. [置顶] 【Android应用开发】Android(安卓
  4. Android L还未正式到来 Android M已崭露
  5. Android百度推送使用详解
  6. android通过反射代替R来获取控件对象
  7. 关于Android下的JNI编程、SO库以及NDK的
  8. 同样的互联网大环境下,你连工作都找不到,年
  9. Android中的UI界面控制方式和自定义View
  10. android 画图