<uses-feature android:glEsVersion="integer" android:name="string" />
<manifest>
<uses-sdk>
element, this element allows an application to specify which device-variable
features it uses. In this way, the application
will not be installed on devices that do not offer the feature.
For example, an application might specify that it requires a camera with auto-focus capabilities. If a device does not provide a camera with auto-focus, then it will not allow installation of the application.
In order to maintain strict device compatibility, it's very important that you use this element to declare all features that your application uses. Failure to declare a feature may result your application being installed on a device that does not support the feature and your application failing.
For some features, there may exist a specfic attribute that allows you to define
a version of the feature, such as the version of Open GL used (declared with
glEsVersion
). Other features that either do or do not
exist for a device, such as camera auto-focus, are declared using the
name
attribute.
Any software or hardware features that may vary among Android-powered
devices will be listed on this page among the attributes below. If you see any features
here that you use in your application, you should include a <uses-feature>
element for each one. For example, if your application uses the device
camera, then you should include the following in your AndroidManifest.xml
:
<uses-feature android:name="android.hardware.camera" />
If you declare "android.hardware.camera", then your application is considered
compatible with all devices that include a camera, regardless of whether auto-focus is
available or not. If you also use the auto-focus features (available through the Camera API), then you need to include an additional
<uses-feature>
element that declares the "android.hardware.camera.autofocus"
feature. Also note that you must still request the CAMERA permission. Requesting permission grants your application access to the
appropriate hardware and software, while declaring the features used by
your application ensures proper device compatibility.
Although the <uses-feature>
element is only activated for devices running
API Level 4 or higher, it is safe to include this for applications that declare
a minSdkVersion
of "3" or lower. Devices running older versions of the platform
will simply ignore this element, but newer devices will recognize it and enforce
installation restrictions based on whether the device supports the feature.
Note:
For each feature required by your application, you must include a new <uses-feature>
element. Multiple features cannot be declared in one
instance of this element.
android:name
Feature | Value | Description |
---|---|---|
Camera | "android.hardware.camera " |
The application requires a camera. |
"android.hardware.camera.autofocus " |
The application requires a camera with auto-focus capability.
As a prerequisite, "android.hardware.camera " must also be declared
with a separate <uses-feature> element.
|
|
Note: Any application that requests the
CAMERA permission but does not
declare any camera features with the <uses-feature> element will be assumed
to use all camera features (such as auto-focus). Thus, the application will not
be compatible with devices that do not support all features. Please use
<uses-feature> to declare only the camera features that your
application needs.
|