AndroidManifest. xml & lt; uses-feature & gt; node, androidmanifest

Source: Internet
Author: User
Tags home screen

<Uses-feature> node of AndroidManifest. xml, androidmanifest

References: http://developer.android.com/guide/topics/manifest/uses-feature-element.html

The <uses-feature> label is located in the <manifest> label. Multiple labels can be used to declare the hardware or software functions that the application depends on. However, this is limited to declarations. These functions are not checked during installation. In actual code, you still need to use PackageManager to determine whether the current environment supports the function. The true purpose of these declarations is to tell external applications what devices are designed for. This allows other services (such as app stores) or other applications to obtain and interact with them, recommend suitable applications for suitable devices.

Syntax:

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

 

Attribute:

Android: name

Dependent hardware or software function name

Android: required

If this parameter is set to true, it indicates that the function of the device is required and the application cannot run normally without this function.
If this parameter is set to false, it indicates that the function of the device is not required and the application can run normally without this function.
The default value is true.

Android: glEsVersion

If the application depends on OpenGL ES, enter the version number here. The version number is represented by an integer. The integer height is 16 bits, and the value is 16 bits. For example, the version number of OpenGL ES 2.0 is 0x00020000. The entire application can declare at most one glEsVersion. If there are multiple declarations, the largest version is used. If the application does not declare this attribute, the default value is OpenGL ES 1.0. OpenGL ES is backward compatible, so you only need to declare the version with the highest version.

Obtain function information dynamically:

When an application is running, you need to determine whether the device supports the function. The PackageManager. getSystemAvailableFeatures method can be used to obtain all functions supported by the device. The PackageManager. hasSystemFeature method can be used to determine whether the device supports a certain function.

PackageInfo. reqFeatures can be used to obtain all declared functional dependencies of an application.

Hardware menu:

Note that sub-functions must be declared by the parent function. At least android: required = "false"

Audio
Android. hardware. audio. low_latency
Low-latency audio channels are used in scenarios with relatively low latency.

Bluetooth
Android. hardware. bluetooth
Bluetooth
Android. hardware. javasth_le
Bluetooth 4.0 LE (Bluetooth Smart)

Camera
Android. hardware. camera
Camera Functions
Android. hardware. camera. autofocus
Auto Focus
Android. hardware. camera. flash
Flashlight
Android. hardware. camera. front
Front camera
Android. hardware. camera. any
Cameras in any direction
Android. hardware. camera. external
Extended camera

Infrared
Android. hardware. consumerir
Infrared Communication

Positioning
Android. hardware. location
Use one or more methods to locate
Android. hardware. location. network
Use Network Positioning
Android. hardware. location. gps
Gps Positioning

Microphone
Android. hardware. microphone
Microphone Functions

Near-Field Communication
Android. hardware. nfc
Near-Field Communication
Android. hardware. nfc. hce
HCE Function

Sensor
Android. hardware. sensor. accelerometer
Accelerator
Android. hardware. sensor. barometer
Barometer
Android. hardware. sensor. compass
Compass
Android. hardware. sensor. gyroscope
Gyroscope
Android. hardware. sensor. light
Light Sensor
Android. hardware. sensor. proximity
Short-range sensor
Android. hardware. sensor. stepcounter
Pedometer
Android. hardware. sensor. stepdetector
Step Detector

Screen
Android. hardware. screen. landscape
Landscape Screen
Android. hardware. screen. portrait
Portrait Screen
If the application supports two directions, you do not need to declare the above two features.

Phone number
Android. hardware. telephony
Telephone Functions
Android. hardware. telephony. cdma
Cdma calls
Android. hardware. telephony. gsm
Gsm call

TV
Android. hardware. type. television
TV Functions

Touch Screen
Android. hardware. faketouch
Basic touch screen function, only click
Android. hardware. touchscreen
Supports the touch function of gestures. This function has been declared by default. If you want to declare that the application supports non-touch, you can set required to false.
Android. hardware. touchscreen. multitouch
Two-touch
Android. hardware. faketouch. multitouch. distinct
Two-or multi-click touch
Android. hardware. faketouch. multitouch. jazzhand
Five or more clicks
Android. hardware. touchscreen. multitouch. distinct
Two-or multi-touch
Android. hardware. touchscreen. multitouch. jazzhand
Five or more touch points

USB
Android. hardware. usb. host
Function as a USB host port
Android. hardware. usb. accessory
Function as a USB Client

WIFI
Android. hardware. wifi
Use wifi
Android. hardware. wifi. direct
Wifi direct connection

Software menu:

Android. software. app_widgets
Provides desktop Components

Android. software. device_admin
Provides the Device Manager function.

Android. software. home_screen
Provides the custom home screen program function

Android. software. input_methods
Provides custom input methods

Android. software. live_wallpaper
Provides the custom live wallpaper Function

Android. software. sip
Provides the SIP Function

Android. software. sip. voip
Digital analog signals

In addition, you need to declare the corresponding permissions to use the hardware and software functions provided by the system in the Code. The following table lists the functions and permissions:
Http://developer.android.com/guide/topics/manifest/uses-feature-element.html#permissions


<Uses-feature android: name = "androidhardwarecamera"/>

This is the permission to control the camera.

Android AndroidManifestxml

<Uses-feature android: name = "android. hardware. camera "/> This indicates that your app needs to use the camera feature. If your mobile phone does not support camera, you cannot see your published app on the market.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.