AndroidManifest. Detailed explanation of XML uses feature function

This article gives an example of Android manifest XML uses feature function. Share with you for your reference, as follows:

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

Android Market will filter all apps that your device does not support according to the uses feature. By using the < uses feature > element, an application can specify the hardware model it supports. For example, if some devices do not support multi touch or OpenGL es 2.0, the filter will filter the applications that need these 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:

The name attribute specifies the characteristics of the application, and the required attribute tells the filter whether we need the support of the device in any case, or just "nice to have".

The last attribute is optional and is only used when you need to specify an OpenGL es version.

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 scale. These types of screens have different abilities to track multiple fingers, so you must ensure that the performance of this screen can support the game.

android. hardware. touchscreen. multitouch. Distinct: This is a brother attribute of multi touch. It requires the device to provide complete multi touch function.

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

Another very useful thing in game development is to specify the required OpenGL es version. In this book, we only care about OpenGL Es1 0 and OpenGL Es1 Just 1. Since there is basically no difference between the two, we don't need to specify < uses feature >. However, some devices support more powerful OpenGL ES2 0

If your game needs more powerful graphics processing power, 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 generally not used here. We only filter devices that cannot provide sufficient graphics processing capacity. The following shows how we can implement it.

It will enable our game to be seen only by devices that support OpenGL es 2.0 and pretend to have considerable graphics processing power.

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

Now in terms of hardware, your application has directly reduced a lot 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 needs multi touch support, but we can also think about another way. If the game can run well on devices that support single touch, we can write code for two paths and run on two devices respectively.

PS: about androidmanifest For XML file related attribute functions, please refer to our online tools:

Description of Android manifest functions and permissions: http://tools.jb51.net/table/AndroidManifest

For more Android related content, readers who are interested can view the topics on this site: summary of Android database operation skills, summary of activity operation skills of Android programming, summary of Android file operation skills, summary of SD card operation methods of Android programming and development, introduction and advanced tutorial of Android development, summary of Android resource operation skills Android view skills summary and Android control usage summary

I hope this article will help you in Android programming.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>