Androidmanifest.xml uses-feature function Detailed _android

Source: Internet
Author: User

This article describes the Androidmanifest.xml uses-feature function. Share to everyone for your reference, specific as follows:

If you're an Android user and you have an old Android device with Android 1.5 installed, you might notice that some of the newer apps don't show up on the Android Market on the phone. This must be the result of the application using <uses-feature>.

The Android market will filter all applications that your device does not support according to Uses-feature. By using the <uses-feature> element, an application can specify the hardware model it supports, for example, some devices do not support multi-touch or OpenGL ES 2.0, then the filter will filter for these hardware support (multitouch or OpenGL ES 2.0 applications, users will not see these apps on Android Market.

A <uses-feature> element contains the following properties:

Copy Code code as follows:
<uses-feature android:name= "string" android:required=["true" | "false"] android:glesversion= "integer"/>

The Name property specifies the characteristics of the application, and the Required property tells the filter whether we have to need the support of this device under any circumstances, or just "nice to have".

The last attribute is optional, just when you need to specify an OpenGL ES version.

The next few hardware features are very useful for game development.

Android.hardware.touchscreen.multitouch: It requires the device to have a multi-touch screen to support basic multi-touch interactions, such as shrinking (magnifying) the image proportions. The ability of these types of screens to track multiple fingers is different, so you have to make sure that the performance of this screen is able to support the game.

Android.hardware.touchscreen.multitouch.distinct: This is a multi-touch sibling attribute that requires the device to be equipped with a complete multi-touch function.

We'll see multi-touch in the next chapters. Now just remember that when your game needs a multi-touch screen, we can use the <uses-feature> element to remove all devices that do not support multi-touch, as follows:

Copy Code code as follows:
<uses-feature android:name= "Android.hardware.touchscreen.multitouch" android:required= "true"/>

Another useful in game development is to specify the desired OpenGL ES version. In this book, we are only interested in OpenGL ES1.0 and OpenGL ES1.1. Since these 2 are basically no different, so we do not have to specify <uses-feature>. However, some devices support more powerful OpenGL ES2.0

If your game requires more powerful graphics processing capabilities, we can specify OpenGL ES 2.0, and our game will only be seen by devices that support OpenGL ES 2.0. Note that OpenGL ES 2.0 is not generally used here, and we simply filter out devices that do not provide sufficient graphics processing capability. The following shows how we can implement it.

Copy Code code as follows:
<uses-feature android:glesversion= "0x00020000" required= "true"/>

It will make our game only supported by OpenGL ES 2.0 and pretend to have considerable graphics processing capabilities for the device to see.

Note: Some devices reflect a performance feature that is not correct, so develop your application as much as possible to support a variety of different devices. Be cautious about using <uses-feature>.

Now with the hardware, your application has directly reduced the number of installation, which will directly affect the sales of your application. So please think carefully before you define <uses-feature>. For example, if your game requires multi-touch support, but we can also think of another way that the game works well on devices that support a single touch, we can write 2-path code that runs on both devices.

PS: About Androidmanifest.xml file related properties can refer to the site online tools:

Android manifest Features and Permissions description Encyclopedia:
Http://tools.jb51.net/table/AndroidManifest

For more information on Android-related content readers can view the site topics: "Android Database Operating skills summary", "Android programming activity Operation Skills Summary", "Android File Operation skills Summary", " Android programming development of the SD card operation method Summary, "Android Development introduction and Advanced Course", "Android Resource Operation skills Summary", "Android View tips Summary" and "Android Control usage Summary"

I hope this article will help you with your Android programming.

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.