Androidmanifest. XML uses-feature

Source: Internet
Author: User

If you are an android user and you have an old Android device installed with Android 1.5, you may notice that some later apps are not displayed in the Android Market on your mobile phone. This must be the result of the application using <uses-feature>.

The Android Market filters out all applications not supported by your device based on the uses-feature. By using the <uses-feature> element, an application can specify the Supported Hardware model. For example, some devices do not support multi-touch or OpenGL ES 2.0, then, the filter filters applications that require hardware support (multi-touch or OpenGL ES 2.0) and users will not see these applications on the Android Market.

A <uses-feature> element contains the following attributes:
<Uses-feature Android: Name = "string" Android: required = ["true" | "false"] Android: glesversion = "integer"/>

The name attribute specifies the features of the application. The required attribute tells the filter whether it is necessary to support the device under any circumstances, or simply "nice to have ".

The last attribute is optional. It is only used when an OpenGL ES version needs to be specified.

The following 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 interaction, such as shrinking (enlarging) the image ratio. These types of screen tracking have different capabilities for multiple fingers, so you must ensure that the performance of this screen is supported by the game.

Android. Hardware. touchscreen. multitouch. distinct: This is a sibling attribute of multi-touch. It requires devices to provide complete multi-touch functions.

We will see multi-touch in the next section. Now remember that when your game needs a screen that supports multi-touch, we can use the <uses-feature> element to remove all devices that do not support multi-touch, as shown below:

<Uses-feature Android: Name = "android. Hardware. touchscreen. multitouch" Android: required = "true"/>

Another useful feature in game development is to specify the required OpenGL ES version. In this book, we only care about OpenGL es1.0 and OpenGL es1.1. Since the two are basically no different, we do not need 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 then our game will only be seen by devices that support OpenGL ES 2.0. Note that OpenGL ES 2.0 is not used in this book. We just filter devices that do not provide sufficient graphic processing capabilities. The following shows how to implement it.

<Uses-feature Android: glesversion = "0x00020000" required = "true"/>

It will make our game only visible to devices that support OpenGL ES 2.0 and pretend to have considerable graphic processing capabilities.

Note: the performance characteristics of some devices are incorrect, so try to support different devices when developing your applications. Use <uses-feature> with caution.

Now, in terms of hardware, your application has directly reduced a lot of installation volume, which will directly affect your application sales. Therefore, consider it carefully before you define <uses-feature>. For example, if your game requires multi-touch support, but we can also think about another way, that is, the game can run well on devices that support single-touch, we can write two paths of code and run them on two devices respectively.

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.