需要了解Android中的使用功能 [英] Need to know about uses-feature in Android

查看:91
本文介绍了需要了解Android中的使用功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

uses-feature的使用方式如下:

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

android:requiredandroid:glEsVersion的用途是什么?

推荐答案

required用于表明应用程序使用的功能对应用程序必不可少;没有该功能,该应用将无用或无法正常工作.例如,如果您的应用使用gps作为必备功能功能,但并非绝对必要,则可以将required设置为false.这样,使用没有gps设备的设备的用户仍然可以从Play商店下载您的应用程序,否则他们将无法下载.

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.在这种情况下,您可能希望至少指定一个要在上下文中使用的版本.

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:

必需元素提供了必填属性,可让您指定应用程序是否需要且没有声明的功能就不能运行,或者它是否希望拥有该功能但没有该功能就可以运行. ( Android开发指南)

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 对于某些功能,可能存在一个特定的属性,该属性可让您定义功能的版本,例如使用的Open GL版本(由glEsVersion声明). […]应用程序应在其清单中最多指定一个android:glEsVersion属性.如果指定多个值,则使用数值最高的android:glEsVersion,而忽略其他任何值.如果应用程序未指定android:glEsVersion属性,则假定该应用程序仅需要OpenGL ES 1.0,而所有受Android支持的设备都支持OpenGL ES 1.0. ( Android开发指南)

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)

您可以在 Android开发人员中阅读有关<uses-feature>的更多信息.准则

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

这篇关于需要了解Android中的使用功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆