Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need to know about uses-feature in Android

uses-feature is used in following way:

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

What is the use of android:required and android:glEsVersion?

like image 768
aman arora Avatar asked Jul 28 '15 11:07

aman arora


2 Answers

required is used to show that the feature the app uses is essential to the application; without that feature the app would be useless or wouldn't work. If your app uses gps, for example, as a nice-to-have feature but it isn't absolutely necessary, you could set required to false. This way, users with devices that don't have devices with gps can still download your app from the Play Store—which they otherwise couldn't.

glEsVersion is necessary only if the feature requires OpenGL ES. In that case you might want to specify at least one version to be used in the context.


Or as the developer guidelines state:

required The element offers a required attribute that lets you specify whether your application requires and cannot function without the declared feature, or whether it prefers to have the feature but can function without it. (Android Dev Guidelines)

glEsVersion For some features, there may exist a specific attribute that allows you to define a version of the feature, such as the version of Open GL used (declared with glEsVersion). […] An application should specify at most one android:glEsVersion attribute in its manifest. If it specifies more than one, the android:glEsVersion with the numerically highest value is used and any other values are ignored. If an application does not specify an android:glEsVersion attribute, then it is assumed that the application requires only OpenGL ES 1.0, which is supported by all Android-powered devices. (Android Dev Guidelines)

You can read more about <uses-feature> in the Android Developer Guidelines

like image 88
PattaFeuFeu Avatar answered Sep 27 '22 18:09

PattaFeuFeu


android:required is useful when every device not support hardware or feature which your app needs.

Example : My app is useful for backup purpose of SMS,contact,calllog,apk etc. But some tablets doesn't has sim card then android:required="false" work for me if that app run on that device.

android:glEsVersion The OpenGL ES version required by the application. The higher 16 bits represent the major number and the lower 16 bits represent the minor number. For example, to specify OpenGL ES version 2.0, you would set the value as "0x00020000", or to specify OpenGL ES 3.0, you would set the value as "0x00030000".

like image 29
SANAT Avatar answered Sep 27 '22 16:09

SANAT