http://blog.csdn.net/think_soft/article/details/7596796
Syntax (SYNTAX):
<uses-featureAndroid:name="string"
android:required =["true" |
glesversion =" Integer "/>
Included in (CONTAINED in):
<manifest>
Description (DESCRIPTION):
This element is used to declare a separate hardware or software function used by the application.
The purpose of the <uses-feature> statement is to inform other external entities of the hardware and software features that the application relies on. This element provides a required property that allows you to specify whether the application will function properly if the required functionality does not exist. Because features can be supported by different Android devices, the <uses-feature> element is used to describe the important, available device functionality that the application relies on.
The set of available functions declared by the application corresponds to a set of available functional constants defined by the Android Packagemanager class, which are listed in the feature reference table in Google play and feature-based filtering for convenience.
If your application requires more than one feature, use the <uses-feature> element to specify each of the required features, such as an application that requires Bluetooth and camera features on the device, to declare two <uses-feature> elements:
<uses-featureandroid:name="Android.hardware.bluetooth"/>
<uses-featureandroid:name="Android.hardware.camera"/>
You should always make sure that you use the <uses-feature> element to declare all the functionality that your application requires.
The declared <uses-feature> element is informational only, which means that the Android system itself does not check the compatibility of the features supported on the device before installing the application. However, other services (such as Google Play) or applications can check the <uses-feature> statement of the application as part of interacting with the application. For this reason, it is critical to declare all the external features that the application will use.
For some features, it is possible to have a specific property in order to define the version of the feature, such as the version of the Open GL being used ( declared with Glesversion ). Some features do not need to specify a version attribute, such as a camera, to be declared using only the name attribute.
Although the <uses-feature> element only works on versions running API level 4 or higher, it is recommended to include this element in all applications, even if the minsdkversion the value is 3 or lower, these devices that run the old platform version simply ignore this element.
Note: When declaring a feature, remember that you must request the appropriate permissions. For example, You must request camera permissions before an application can access the camera's API. The application permission is for the application to have access to the appropriate software / hardware, while declaring that the application uses the functionality to ensure proper device compatibility.
Properties (ATTRIBUTES):
Android:name
This property uses a descriptive string that specifies the soft/hardware functionality used by the application. Valid descriptors are listed in the "Hardware Features" and "Software features" tables of Google play and feature-based filtering.
Android:required
This property uses a Boolean value to specify whether the application needs the functionality specified in the Android:name property.
True: The app does not function correctly when the specified feature does not exist on the device.
False: If the specified feature is present on the device, the application will tend to use this feature, but it can also be designed to function correctly if required.
If not declared, the default value for this property is true.
Android:qlesversion
This property is used to declare the version of OpenGL ES required by the application. Its high 16 bits represent the major version number, and the lower 16 bits represent the minor version number, such as: if the version number of the specified OpenGL ES is 2.0, then set to 0x00020000. The version number of the OpenGL ES to be specified is 2.1 and is set to 0x00020001.
The application should specify at most one android:glesversion attribute in its manifest, and if more than one is specified, only the highest version of the Android:glesversion property will be used, while the others will be ignored.
If the application does not specify a Android:glesversion property, then it is assumed that the application requires only OpenGL ES1.0, which is the version supported on all Android devices.
The application can assume that if a platform supports the set OpenGL ES version, it will also support all versions of OpenGL ES that are set to a low version, so OpenGL ES1.0 and OpenGL are required ES2.0 application, you must specify the version that it needs when OpenGL ES2.0.
Applications that can work with any version of OpenGL ES should specify only the minimum version of OpenGL ES required by the app. (The application is able to check at run time if a higher version of OpenGL ES is available.) )
Introduced version (introduced in):
API Level 4
Androidmanifest.xml file (uses-feature)