If you are an Android user and you have an older Android device with Android 1.5 installed, you can
You will notice that some of the newer apps are not shown in Android Market on your phone. This must be an application use
The results of <uses-feature>.
Android Market Filters All apps that your device doesn't support based on 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 be filtered to require 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: <uses-feature android:name= "string" android:required=["true" | "False"]
android:glesversion= "integer"/>
The Name property specifies the characteristics of the app, and the Required property tells the filter whether we must in any case need this
Devices, or just "nice to have".
The last attribute is optional and is used only 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 the base
This is a multi-touch interaction, such as shrinking (enlarging) the image scale. These types of screens have the ability to track multiple fingers
Different, so you have to make sure that the performance of this screen is capable of supporting the game.
Android.hardware.touchscreen.multitouch.distinct: This is a multi-touch sibling attribute that
Requires a device for complete multi-touch functionality.
We'll see multi-touch in the next chapter fragment. Now just remember that when your game needs a support for more
Touch screen, we can use the <uses-feature> element to remove any setting that does not support multi-touch
Like this:
<uses-feature android:name= "Android.hardware.touchscreen.multitouch"
Android:required= "true"/>
Another useful thing in game development is to specify the desired OpenGL ES version. In this book, we only care about
OpenGL ES1.0 and OpenGL ES1.1 are available. Since these 2 people are basically no different, we don't have to
To specify the <uses-feature>. However, some devices support the more powerful OpenGL ES2.0
If your game requires 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 not used in this book and we only
is to filter devices that do not provide sufficient graphics processing power. The following shows how we can implement it.
<uses-feature android:glesversion= "0x00020000" required= "true"/>
It will make our game only be seen by devices that support OpenGL ES 2.0 and pretend to have considerable graphics processing power.
Note: Some devices reflect performance characteristics that are not correct, so when developing your application, try to support a variety of
The same equipment. Be cautious about using <uses-feature>.
Now, with hardware, your app has directly reduced many installs, which will directly affect your app's sales
。 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 games can run well on devices that support single touch
, we can write 2 paths of code that run on both devices.
From for notes (Wiz)
Android Androidmanifest.xml Uses-feature Detailed