- 浏览: 580328 次
- 性别:
- 来自: 广州
文章分类
- 全部博客 (338)
- 已过时文章(留念用) (39)
- Android学习笔记 (30)
- Android开发指引自译 (100)
- Android NDK文档自译 (23)
- Android设计指引自译 (2)
- xp(ペケピー)&linux(理奈、铃)酱~ (4)
- ui酱&歌词自译~ (9)
- lua酱~ (9)
- 自我反省 (1)
- 羽game计划 (1)
- XSL酱 (2)
- java酱 (3)
- 设计的领悟 (58)
- 涂鸦作品(pixiv) (1)
- ruby酱 (2)
- Objective-C编程语言自译 (2)
- Android开发月报 (6)
- objc酱 (2)
- photoshop (3)
- js酱 (6)
- cpp酱 (8)
- antlr酱 (7)
- Lua 5.1参考手册自译 (11)
- 收藏品 (3)
- 待宵草计划 (4)
- 体验版截图 (1)
最新评论
-
naruto60:
太给力了!!!!我这网打不开Intel官网,多亏楼主贴了连接, ...
使用HAXM加速的Android x86模拟器(和一些问题) -
yangyile2011:
谢谢博主,翻译得很好哦
【翻译】(4)片段 -
ggwang:
牙痛的彼岸:痹!
牙痛的彼岸 -
ggwang:
总结得很简练清晰啊,学习了!
ANTLR学习笔记一:概念理解 -
leisurelife1990:
mk sdd
用git下载Android自带app的源代码
【翻译】(66)uses-feature元素
see
http://developer.android.com/guide/topics/manifest/uses-feature-element.html
原文见
http://developer.android.com/guide/topics/manifest/uses-feature-element.html
-------------------------------
<uses-feature>
uses-feature元素
-------------------------------
In this document
本文目录
* Android Market and Feature-Based Filtering Android市场和基于特性的过滤
* Filtering based on explicitly declared features 基于显式声明特性的过滤
* Filtering based on implicit features 基于隐式特性的过滤
* Special handling for Bluetooth feature 蓝牙特性的特殊处理
* Testing the features required by your application 测试你的应用程序必需的特性
* Features Reference 特性参考
* Hardware features 硬件特性
* Software features 软件特性
* Permissions that Imply Feature Requirements 暗示特性要求的权限
-------------------------------
* syntax:
* 语法:
-------------------------------
<uses-feature android:name="string"
android:required=["true" | "false"]
android:glEsVersion="integer" />
-------------------------------
* contained in:
* 被包含在:
<manifest>
-------------------------------
Android Market and <uses-feature> elements
Android市场和<uses-feature>元素
Android Market filters the applications that are visible to users, so that users can see and download only those applications that are compatible with their devices. One of the ways Market filters applications is by feature compatibility.
Android市场过滤对于用户可见的应用程序,使用户只可以看到和下载那些兼容它们的设备的应用程序。市场过滤应用程序的其中一种方式是通过特性兼容性。
To do this, Market checks the <uses-feature> elements in each application's manifest, to establish the app's feature needs. Market then shows or hides the application to each user, based on a comparison with the features available on the user's device.
为了做到这点,市场检查每个应用程序的清单中的<uses-feature>元素,以建立应用的特性需要。然后市场对每个用户显示或隐藏应用程序,基于与用户设备上可用特性的比较。
By specifying the features that your application requires, you enable Android Market to present your application only to users whose devices meet the application's feature requirements, rather than presenting it to all users.
通过指定你的应用程序必需的特性,你使Android市场只把你的应用程序呈现给持有满足应用程序要求的设备的用户,而非把它呈现给所有用户。
-------------------------------
For important information about how Android Market uses features as the basis for filtering, please read Android Market and Feature-Based Filtering, below.
想获得关于Android市场如何使用特性作为过滤的基础的重要信息,请阅读Android市场和下面的基于特性的过滤。
-------------------------------
-------------------------------
* description:
* 描述:
Declares a single hardware or software feature that is used by the application.
声明一个单一硬件或软件特性,它被应用程序使用。
The purpose of a <uses-feature> declaration is to inform any external entity of the set of hardware and software features on which your application depends. 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. Because feature support can vary across Android devices, the <uses-feature> element serves an important role in letting an application describe the device-variable features that it uses.
<uses-feature>声明的目的是为了告知任意外部实体关于你的应用程序所依赖的硬件和软件特性集合。该元素提供一个必需属性,它让你指定你的应用程序是否必需它和在没有被声明特性的情况下不能起作用,或者它是否倾向于拥有特性但可以在没有它的情况下其作用。因为特性支持可以跨Android设备而不同,所以<uses-feature>元素起到一个重要的作用,让一个应用程序描述它使用的设备差别特性。
The set of available features that your application declares corresponds to the set of feature constants made available by the Android PackageManager, which are listed for convenience in the Features Reference tables at the bottom of this document.
你的应用程序的可用特性集合对应被Android的PackageManager制造的可用特性常量集合,出于方便它们被列举在本文档底部的特性参考表格中。
You must specify each feature in a separate <uses-feature> element, so if your application requires multiple features, it would declare multiple <uses-feature> elements. For example, an application that requires both Bluetooth and camera features in the device would declare these two elements:
你必须在一个分离<uses-feature>元素中指定每个特性,所以如果你的应用程序必需多个特性,它将声明多个<uses-feature>元素。例如,一个需要设备中蓝牙和照相机特性的应用程序将声明这两个元素:
-------------------------------
<uses-feature android:name="android.hardware.bluetooth" />
<uses-feature android:name="android.hardware.camera" />
-------------------------------
In general, you should always make sure to declare <uses-feature> elements for all of the features that your application requires.
通常,你应该总是确保为你的应用程序必需的所有特性声明<uses-feature>元素。
Declared <uses-feature> elements are informational only, meaning that the Android system itself does not check for matching feature support on the device before installing an application. However, other services (such as Android Market) or applications may check your application's <uses-feature> declarations as part of handling or interacting with your application. For this reason, it's very important that you declare all of the features (from the list below) that your application uses.
被声明的<uses-feature>元素只是含信息的,它意味着Android系统自身并不在安装一个应用程序前检查在设备上匹配的特性支持。然而,其它服务(诸如Android市场)或应用程序可能检查你的应用程序的<uses-feature>声明作为处理或交互你的应用程序的一部分。因此,非常重要的是你声明你的应用程序使用的所有特性(从下面的列表中)。
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). Other features that either do or do not exist for a device, such as a camera, are declared using the name attribute.
对于一些特性,那里可能存在一个特定的属性,它允许你定义特性的版本,诸如Open GL使用的版本(用glEsVersion声明)。其它对于一个设备或者存在或者不存在的特性,诸如照相机,使用name属性来声明。
Although the <uses-feature> element is only activated for devices running API Level 4 or higher, it is recommended to include these elements for all applications, even if the minSdkVersion is "3" or lower. Devices running older versions of the platform will simply ignore the element.
虽然<uses-feature>元素只对于运行API级别4或更高的设备是被激活的,然而建议对所有应用程序包含这些元素,即便minSdkVersion是"3"或更低。运行较旧版本平台的设备将简单地忽略该元素。
-------------------------------
Note: When declaring a feature, remember that you must also request permissions as appropriate. For example, you must still request the CAMERA permission before your application can access the camera API. Requesting the permission grants your application access to the appropriate hardware and software, while declaring the features used by your application ensures proper device compatibility.
注意:当生命一个特性时,记住你还必须合适地请求权限。例如,你仍必须在你的应用程序可以访问照相机API之前请求CAMERA权限。请求的权限授权你的应用程序访问合适的硬件和软件,同时声明被你的应用程序使用的特性确保合适的设备兼容性。
-------------------------------
* attributes:
* 属性:
* android:name
Specifies a single hardware or software feature used by the application, as a descriptor string. Valid descriptor values are listed in the Hardware features and Software features tables, below.
指定被应用程序使用的单一硬件或软件特性,作为一个描述符字符串。可用描述符值被列举在下面的硬件特性和软件特性表格中。
* android:required
Boolean value that indicates whether the application requires the feature specified in android:name.
布尔值,它指示应用程序是否需要在android:name中指定的特性。
* When you declare "android:required="true" for a feature, you are specifying that the application cannot function, or is not designed to function, when the specified feature is not present on the device.
* 当你为一个特性声明android:required="true"时(注:此处多一个引号),你正在指定当指定的特性在设备上不存在时,应用程序不能起作用,或者不被设计成起作用。
* When you declare "android:required="false" for a feature, it means that the application prefers to use the feature if present on the device, but that it is designed to function without the specified feature, if necessary.
* 当你为一个特性声明android:required="false",这意味着应用程序倾向于使用特性如果它在设备上存在,但它被设计成没有指定特性下仍起作用,如果必要的话。
The default value for android:required if not declared is "true".
android:required的默认值,如果没有被声明,为"true"。
* 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". To specify OpenGL ES 2.1, if/when such a version were made available, you would set the value as "0x00020001".
应用程序必需的OpenGL ES版本。高16位代表主数字而低16位代表次数字。例如,为了指定OpenGL ES版本2.0,你将设置该值为"0x00020000"。为了指定OpenGL ES 2.1,如果/当这么一个版本被制造出来可用的话(注:这里的2.1只是个假设),你将设置该值为"0x00020001"。
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.
一个应用程序应该在它的清单中指定至少一个android:glEsVersion属性。如果它指定多于一个,那么带有数值上最高的值的android:glEsVersion被使用而其它任意值被忽略。
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:glEsVersion属性,那么它被假设应用程序只需要OpenGL ES 1.0,它被所有基于Android的设备支持。
An application can assume that if a platform supports a given OpenGL ES version, it also supports all numerically lower OpenGL ES versions. Therefore, an application that requires both OpenGL ES 1.0 and OpenGL ES 2.0 must specify that it requires OpenGL ES 2.0.
一个应用程序可以假设如果一个平台支持一个给定的OpenGL ES版本,它也支持所有数值上较低的OpenGL ES版本。因此,一个同时需要OpenGL ES 1.0和OpenGL ES 2.0的应用程序必须指定它需要OpenGL ES 2.0。
An application that can work with any of several OpenGL ES versions should only specify the numerically lowest version of OpenGL ES that it requires. (It can check at run-time whether a higher level of OpenGL ES is available.)
一个可以和几个OpenGL ES版本中的任意一起工作的应用程序应该只指定它所需要的数值上最低版本的OpenGL ES。(它可以在运行期检查一个较高级别的OpenGL ES是否可用。)
* introduced in:
* 引入:
API Level 4
API级别4
* see also:
* 另见:
* PackageManager
* FeatureInfo
* ConfigurationInfo
* <uses-permission>
* Android Market Filters Android市场过滤器
-------------------------------
Android Market and Feature-Based Filtering
Android市场和基于特性的过滤
Android Market filters the applications that are visible to users, so that users can see and download only those applications that are compatible with their devices. One of the ways Market filters applications is by feature compatibility.
Android市场过滤对于用户可见的应用程序,致使用户只可以看到并下载那些兼容他们的设备的应用程序。市场过滤应用程序的其中一种方式是通过特性兼容性。
To determine an application's feature compatibility with a given user's device, the Android Market service compares:
为了确定一个应用程序对一台给定的用户设备的特性兼容性,Android市场服务比较:
* Features required by the application — an application declares features in <uses-feature> elements in its manifest
* 应用程序需要的特性——一个应用程序它的清单中的<uses-feature>元素中声明特性
with...
和……
* Features available on the device, in hardware or software — a device reports the features it supports as read-only system properties.
* 在设备上可用的特性,在硬件或软件方面——一台设备报告它支持的特性作为只读的系统属性。
To ensure an accurate comparison of features, the Android Package Manager provides a shared set of feature constants that both applications and devices use to declare feature requirements and support. The available feature constants are listed in the Features Reference tables at the bottom of this document, and in the class documentation for PackageManager.
为了确保特性的精确比较,Android包管理器提供特性常量的共享集合,应用程序和设备都使用它来声明特性要求和支持。可用特性常量被列举在本文档底部的特性参考表格中,以及在PackageManager的类文档中。
When the user launches the Market application, the application queries the Package Manager for the list of features available on the device by calling getSystemAvailableFeatures(). The Market application then passes the features list up to the Android Market service when establishing the session for the user.
当用户启动市场应用程序时,应用程序通过调用getSystemAvailableFeatures()询问包管理器在设备上可用的特性列表。然后市场应用程序把特性列表上传给Android市场服务,当为用户建立会话时。
Each time you upload an application to the Android Market Publisher Site, Android Market scans the application's manifest file. It looks for <uses-feature> elements and evaluates them in combination with other elements, in some cases, such as <uses-sdk> and <uses-permission> elements. After establishing the application's set of required features, it stores that list internally as metadata associated with the application .apk and the application version.
每当你上传应用程序到Android市场发布者网站时,Android市场扫描应用程序的清单文件。它寻找<uses-feature>元素并评估它们结合其它元素,在一些情况下,诸如<uses-sdk>和<uses-permission>。在建立应用程序的必需特性集合后,它内部地存储那个列表作为与应用程序.apk和应用程序版本关联的元数据。
When a user searches or browses for applications using the Android Market application, the service compares the features needed by each application with the features available on the user's device. If all of an application's required features are present on the device, Android Market allows the user to see the application and potentially download it. If any required feature is not supported by the device, Android Market filters the application so that it is not visible to the user and not available for download.
当一个用户使用Android市场应用程序搜索或浏览应用程序时,服务比较每个应用程序需要的特性和在用户设备上的可用特性。如果一个应用程序的必需特性存在于该设备上,那么Android市场允许用户看到应用程序并隐式地下载它。如果任意必需特性不被设备支持,那么Android市场过滤该应用程序以使它对于用户不可见并且不可以下载。
Because the features you declare in <uses-feature> elements directly affect how Android Market filters your application, it's important to understand how Android Market evaluates the application's manifest and establishes the set of required features. The sections below provide more information.
因为你在<uses-feature>元素中声明的特性直接地影响Android市场如何过滤你的应用程序,所以重要的是理解Android市场如何评估应用程序的清单和建立必需特性集合。以下章节提供更多信息。
Filtering based on explicitly declared features
基于显式声明特性的过滤
An explicitly declared feature is one that your application declares in a <uses-feature> element. The feature declaration can include an android:required=["true" | "false"] attribute (if you are compiling against API level 5 or higher), which lets you specify whether the application absolutely requires the feature and cannot function properly without it ("true"), or whether the application prefers to use the feature if available, but is designed to run without it ("false").
一个显式声明特性是你的应用程序在一个<uses-feature>元素中声明的特性。特性声明可以包含一个android:required=["true" | "false"]属性(如果你正在编译对应API级别5或更高),它让你指定应用程序是否绝对地需要该特性并且不能在没有它的情况下正确地起作用("true"),或者应用程序是否倾向于使用该特性如果它可用,但被设计为没有它的情况下运行("false")。
Android Market handles explicitly declared features in this way:
Android市场用这种方式处理显式声明特性:
* If a feature is explicitly declared as being required, Android Market adds the feature to the list of required features for the application. It then filters the application from users on devices that do not provide that feature. For example:
* 如果一个特性被显式地声明作为必需的,那么Android市场添加特性到应用程序的必需特性列表中。然后它从没有提供那个特性的设备上的用户中过滤掉应用程序。例如:
-------------------------------
<uses-feature android:name="android.hardware.camera" android:required="true" />
-------------------------------
* If a feature is explicitly declared as not being required, Android Market does not add the feature to the list of required features. For that reason, an explicitly declared non-required feature is never considered when filtering the application. Even if the device does not provide the declared feature, Android Market will still consider the application compatible with the device and will show it to the user, unless other filtering rules apply. For example:
* 如果一个特性被显式作为不是必需的,那么Android市场不添加该特性到必需特性列表中。因为那个原因,一个显式声明的非必需特性从不被考虑,当过滤应用程序时。即便设备不提供声明的特性,Android市场将仍然考虑应用程序对设备的兼容以及将把它展示给用户看,除非其它过滤规则应用了。例如:
-------------------------------
<uses-feature android:name="android.hardware.camera" android:required="false" />
-------------------------------
* If a feature is explicitly declared, but without an android:required attribute, Android Market assumes that the feature is required and sets up filtering on it.
* 如果一个特性被显式声明,但不带一个android:required属性,那么Android市场假设特性是必需的并且配置基于它的过滤。
In general, if your application is designed to run on Android 1.6 and earlier versions, the android:required attribute is not available in the API and Android Market assumes that any and all <uses-feature> declarations are required.
通常,如果你的应用程序被设计为运行在Android 1.6和更早的版本上,那么android:required属性在API中不可用,并且Android市场假设任意和所有<uses-feature>声明是必需的(注:required的)。
-------------------------------
Note: By declaring a feature explicitly and including an android:required="false" attribute, you can effectively disable all filtering on Android Market for the specified feature.
注意:通过显式声明一个特性和包含一个android:required="false"属性,你可以有效地屏蔽在Android市场上对特定特性的所有过滤。
-------------------------------
Filtering based on implicit features
基于隐式特性的过滤
An implicit feature is one that an application requires in order to function properly, but which is not declared in a <uses-feature> element in the manifest file. Strictly speaking, every application should always declare all features that it uses or requires, so the absence of a declaration for a feature used by an application should be considered an error. However, as a safeguard for users and developers, Android Market looks for implicit features in each application and sets up filters for those features, just as it would do for an explicitly declared feature.
一个隐式特性是指一个应用程序必需的以让其正常地起作用的特性,但它不被声明在清单文件中的一个<uses-feature>元素中。严格来讲,每个应用程序总是应该声明它使用或需要的所有特性,所以对于一个被应用程序使用的特性的声明的不存在应该被认为是一个错误。然而,作为对用户和开发者的安全措施,Android市场在每个应用程序中寻找隐式特性并且配置对那些特性的过滤,正如它为一个显式声明特性所做的那样。
An application might require a feature but not declare it because:
一个应用程序可能需要一个特性但不声明它,因为:
* The application was compiled against an older version of the Android library (Android 1.5 or earlier) and the <uses-feature> element was not available.
* 应用程序被编译对应Android库的一个较旧版本(Android 1.5或更早)而<uses-feature>元素还不可用。
* The developer incorrectly assumed that the feature would be present on all devices and a declaration was unnecessary.
* 开发者不正确地假设特性将出现在所有设备上而不需要一个声明。
* The developer omitted the feature declaration accidentally.
* 开发者意外地忽略特性声明。
* The developer declared the feature explicitly, but the declaration was not valid. For example, a spelling error in the <uses-feature> element name or an unrecognized string value for the android:name attribute would invalidate the feature declaration.
* 开发者显式地声明特性,但声明不是有效的。例如,在<uses-feature>元素中名称的拼写错误或者用于android:name属性的未识别字符串值将无效化该特性声明。
To account for the cases above, Android Market attempts to discover an application's implied feature requirements by examining other elements declared in the manifest file, specifically, <uses-permission> elements.
为了解决上面的情况,Android市场尝试通过检查在清单文件中声明的其它元素,特别地,<uses-permission>元素,来发现一个应用程序的暗示特性要求。
If an application requests hardware-related permissions, Android Market assumes that the application uses the underlying hardware features and therefore requires those features, even though there might be no corresponding to <uses-feature> declarations. For such permissions, Android Market adds the underlying hardware features to the metadata that it stores for the application and sets up filters for them.
如果一个应用程序请求硬件相关权限,Android市场假设应用程序使用底层硬件特性并且因此需要那些特性,即便可能没有<uses-feature>声明对应它。对于这些特性,Android市场添加底层硬件特性到为应用程序而存储的元数据,并且对它们配置过滤器。
For example, if an application requests the CAMERA permission but does not declare a <uses-feature> element for android.hardware.camera, Android Market considers that the application requires a camera and should not be shown to users whose devices do not offer a camera.
例如,如果一个应用程序请求CAMERA权限但不声明一个用于android.hardware.camera的<uses-feature>元素,那么Android市场认为应用程序需要一个照相机并且不应该显示给不提供照相机的设备的用户。
If you don't want Android Market to filter based on a specific implied feature, you can disable that behavior. To do so, declare the feature explicitly in a <uses-feature> element and include an android:required="false" attribute. For example, to disable filtering derived from the CAMERA permission, you would declare the feature as shown below.
如果你比希望Android市场基于一个特定特性来过滤,你可以屏蔽那个行为。为了做到这点,显式地在<uses-feature>元素中声明该特性并包含一个android:required="false"属性。例如,为了屏蔽继承自CAMERA权限的过滤,你将声明该特性如下所示。
-------------------------------
<uses-feature android:name="android.hardware.camera" android:required="false" />
-------------------------------
-------------------------------
It's important to understand that the permissions that you request in <uses-permission> elements can directly affect how Android Market filters your application. The reference section Permissions that Imply Feature Requirements, below, lists the full set of permissions that imply feature requirements and therefore trigger filtering.
这是重要的以理解你在<uses-permission>元素中请求的权限可以直接地影响Android市场如何过滤你的应用程序。下面参考文档章节,暗示特性要求的权限,列举暗示特性要求的权限的完全集合以及因此而触发的过滤。
-------------------------------
Special handling for Bluetooth feature
对蓝牙特性的特殊处理
Android Market applies slightly different rules than described above, when determining filtering for Bluetooth.
Android市场应用和上面描述的稍微不同的规则,当确定对蓝牙的过滤时。
If an application declares a Bluetooth permission in a <uses-permission> element, but does not explicitly declare the Bluetooth feature in a <uses-feature> element, Android Market checks the version(s) of the Android platform on which the application is designed to run, as specified in the <uses-sdk> element.
如果一个应用程序在<uses-permission>元素中声明一个蓝牙权限,但不显式地在<uses-feature>元素中声明蓝牙特性,那么Android市场检查应用程序被设计以运行在的Android平台的版本,正如<uses-sdk>元素中指定的那样。
As shown in the table below, Android Market enables filtering for the Bluetooth feature only if the application declares its lowest or targeted platform as Android 2.0 (API level 5) or higher. However, note that Android market applies the normal rules for filtering when the application explicitly declares the Bluetooth feature in a <uses-feature> element.
正如下面的表格中所示,Android市场使能对蓝牙的过滤,仅当应用程序声明它的最低或目标平台为Android 2.0(API级别5)或更高。然而,注意Android市场应用正常的过滤规则,当应用程序显式地在一个<uses-feature>元素中声明蓝牙特性。
Table 1. How Android Market determines the Bluetooth feature requirement for an application that requests a Bluetooth permission but does not declare the Bluetooth feature in a <uses-feature> element.
表1. Android市场如何确定对请求蓝牙权限但不在<uses-feature>元素中声明蓝牙特性的应用程序的蓝牙特性要求。
-------------------------------
* If minSdkVersion is ... or targetSdkVersion is Result
* 如果minSdkVersion是…… 或者targetSdkVersion是 结果
* <=4 (or uses-sdk is not declared) <=4 Android Market will not filter the application from any devices based on their reported support for the android.hardware.bluetooth feature.
* <=4(或uses-sdk没有被声明) <=4 Android市场将不从基于它们报告对android.hardware.bluetooth特性的支持的任意设备中过滤掉该应用程序。
* <=4 >=5
* >=5 >=5
Android Market filters the application from any devices that do not support the android.hardware.bluetooth feature (including older releases).
Android市场从不支持android.hardware.bluetooth特性的任意设备(包括较旧的发布版)中过滤掉该应用程序。
-------------------------------
The examples below illustrate the different filtering effects, based on how Android Market handles the Bluetooth feature.
下面的示例描绘不同的过滤效果,基于Android市场如何处理蓝牙特性。
In first example, an application that is designed to run on older API levels declares a Bluetooth permission, but does not declare the Bluetooth feature in a <uses-feature> element.
在第一个示例中,一个不被设计为运行在较旧API级别上的应用程序声明一个蓝牙权限,但不在一个<uses-feature>元素中声明蓝牙特性。
Result: Android Market does not filter the application from any device.
结果:Android市场不从任意设备中过滤掉该应用程序。
-------------------------------
<manifest ...>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-sdk android:minSdkVersion="3" />
...
</manifest>
-------------------------------
In the second example, below, the same application also declares a target API level of "5".
在下面的第二个示例中,相同的应用程序也声明目标API级别为"5"。
Result: Android Market now assumes that the feature is required and will filter the application from all devices that do not report Bluetooth support, including devices running older versions of the platform.
结果:Android市场现在假设特性是必需的并且将从所有不报告蓝牙支持的所有设备中过滤应用程序,包括运行较旧平台版本的设备。
-------------------------------
<manifest ...>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="5" />
...
</manifest>
-------------------------------
Here the same application now specifically declares the Bluetooth feature.
这里相同的应用程序现在特别地声明蓝牙特性。
Result: Identical to the previous example (filtering is applied).
结果:和前面的例子相同(过滤被应用)
-------------------------------
<manifest ...>
<uses-feature android:name="android.hardware.bluetooth" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="5" />
...
</manifest>
-------------------------------
Finally, in the case below, the same application adds an android:required="false" attribute.
最后,在下面的例子中,相同的应用程序添加一个android:required="false"属性。
Result: Android Market disables filtering based on Bluetooth feature support, for all devices.
结果:Android市场屏蔽基于蓝牙特性支持的过滤,对于所有设备。
-------------------------------
<manifest ...>
<uses-feature android:name="android.hardware.bluetooth" android:required="false" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="5" />
...
</manifest>
-------------------------------
Testing the features required by your application
测试你的应用程序需要的特性
You can use the aapt tool, included in the Android SDK, to determine how Android Market will filter your application, based on its declared features and permissions. To do so, run aapt with the dump badging command. This causes aapt to parse your application's manifest and apply the same rules as used by Android Market to determine the features that your application requires.
你可以使用aapt工具,它被包括在Android SDK中,以确定Android市场将如何过滤你的应用程序,基于它的被声明特性和权限。为了做到这点,用dump badging命令(注:dump badging的字面含义是转储商标)运行aapt。这导致aapt解析你的应用程序清单并应用与Android市场相同的规则以确定你的应用程序需要的特性。
To use the tool, follow these steps:
为了使用这个工具,遵循这些步骤:
1. First, build and export your application as an unsigned .apk. If you are developing in Eclipse with ADT, right-click the project and select Android Tools > Export Unsigned Application Package. Select a destination filename and path and click OK.
1. 首先,构建并导出你的应用程序作为一个未签名的.apk文件。如果你正在用带有ADT的Eclipse来开发,请右键工程并选择Android工具>导出未签名应用程序包。选择一个目标文件名和路径并点击确定。
2. Next, locate the aapt tool, if it is not already in your PATH. If you are using SDK Tools r8 or higher, you can find aapt in the <SDK>/platform-tools/ directory.
2. 接下来,定位aapt工具,如果它还未在你的PATH中。如果你正在使用SDK工具r8或更高,你可以在<SDK>/platform-tools/目录中找到aapt。
-------------------------------
Note: You must use the version of aapt that is provided for the latest Platform-Tools component available. If you do not have the latest Platform-Tools component, download it using the Android SDK and AVD Manager.
注意:你必须使用被提供作为可用的最新平台工具组件的aapt版本。如果你没有最新的平台工具组件,请使用Android SDK和AVD管理器下载它。
-------------------------------
3. Run aapt using this syntax:
3. 用这个语法运行aapt:
-------------------------------
$ aapt dump badging <path_to_exported_.apk>
($ aapt dump badging <导出路径.apk>)
-------------------------------
Here's an example of the command output for the second Bluetooth example, above:
这里是一个对应上面第二个蓝牙示例的示例命令行输出:
-------------------------------
$ ./aapt dump badging BTExample.apk
package: name='com.example.android.btexample' versionCode='' versionName=''
uses-permission:'android.permission.BLUETOOTH_ADMIN'
uses-feature:'android.hardware.bluetooth'
sdkVersion:'3'
targetSdkVersion:'5'
application: label='BT Example' icon='res/drawable/app_bt_ex.png'
launchable activity name='com.example.android.btexample.MyActivity'label='' icon=''
uses-feature:'android.hardware.touchscreen'
main
supports-screens: 'small' 'normal' 'large'
locales: '--_--'
densities: '160'
-------------------------------
-------------------------------
Features Reference
特性参考
The tables below provide reference information about hardware and software features and the permissions that can imply them on Android Market.
下面的表格提供关于硬件和软件特性的参考信息以及可以在Android市场上暗示它们的权限。
Hardware features
硬件特性
The table below describes the hardware feature descriptors supported by the most current platform release. To signal that your application uses or requires a hardware feature, declare each value in a android:name attribute in a separate <uses-feature> element.
下面的表格描述被大多数当前平台发行版支持的硬件描述符。为了告知你的应用程序使用或需要一个硬件特性,请在分离的<uses-feature>元素里的android:name属性中声明每个值。
-------------------------------
* Feature Type Feature Descriptor Description Comments
* 特性类型 特性描述符 描述注释
* Audio
* 音频
* android.hardware.audio.low_latency The application uses a low-latency audio pipeline on the device and is sensitive to delays or lag in sound input or output.
* android.hardware.audio.low_latency 应用程序使用设备上的低延迟音频管道并且是敏感于声音输入或输出的延迟或滞后。
* Bluetooth
* 蓝牙
* android.hardware.bluetooth The application uses Bluetooth radio features in the device.
* android.hardware.bluetooth 应用程序使用设备中的蓝牙无线特性。
* Camera
* 照相机
* android.hardware.camera The application uses the device's camera. If the device supports multiple cameras, the application uses the camera that facing away from the screen.
* android.hardware.camera 应用程序使用设备的照相机。如果设备支持多个照相机,那么该应用程序使用反向于屏幕的照相机。
* android.hardware.camera.autofocus Subfeature. The application uses the device camera's autofocus capability.
* android.hardware.camera.autofocus 子特性。应用程序使用设备照相机的自动对焦功能。
* android.hardware.camera.flash Subfeature. The application uses the device camera's flash.
* android.hardware.camera.flash 子特性。应用程序使用设备照相机的闪光灯。
* android.hardware.camera.front Subfeature. The application uses a front-facing camera on the device.
* android.hardware.camera.front 子特性。应用程序使用设备上的前向照相机。
These subfeatures implicitly declare the android.hardware.camera parent feature, unless declared with android:required="false".
这些子特性隐式地声明android.hardware.camera父特性,除非它用android:required="false"声明。(注:这是autofocus、flash、front这三个子特性的注释)
* Location
* 位置
* android.hardware.location The application uses one or more features on the device for determining location, such as GPS location, network location, or cell location.
* android.hardware.location 应用程序使用设备上的一个或多个特性以确定位置,诸如GPS位置,网络位置,或蜂窝位置(注:应该是指蜂窝电话位置,cell phone location)。
* android.hardware.location.network Subfeature. The application uses coarse location coordinates obtained from a network-based geolocation system supported on the device.
* android.hardware.location.network 子特性。应用程序使用从设备上支持的基于网络的地理系统中获得的模糊位置坐标。
* android.hardware.location.gps Subfeature. The application uses precise location coordinates obtained from a Global Positioning System receiver on the device.
* android.hardware.location.gps 子特性。应用程序使用从设备上全球定位系统(注:简称为GPS)接收器中获得的精确位置坐标。
These subfeatures implicitly declare the android.hardware.location parent feature, unless declared with android:required="false".
这些子特性隐式地声明android.hardware.location父特性,除非用android:required="false"声明它。(注:这是network、gps这两个子特性的注释)
* Microphone
* 麦克风
* android.hardware.microphone The application uses a microphone on the device.
* android.hardware.microphone 应用程序使用设备上的麦克风。
* NFC
* NFC(注:Near Field Communication,近场通信)
* android.hardware.nfc The application uses Near Field Communications radio features in the device.
* android.hardware.nfc 应用程序使用设备中的近场通信无线特性。
* Sensors
* 感应器
* android.hardware.sensor.accelerometer The application uses motion readings from an accelerometer on the device.
* android.hardware.sensor.accelerometer 应用程序使用来自设备上的加速计(注:即重力加速度传感器)的动作读取。
* android.hardware.sensor.barometer The application uses the device's barometer.
* android.hardware.sensor.barometer 应用程序使用设备的气压计。
* android.hardware.sensor.compass The application uses directional readings from a magnetometer (compass) on the device.
* android.hardware.sensor.compass 应用程序使用来自设备上磁强计(指南针)的方向读取。
* android.hardware.sensor.gyroscope The application uses the device's gyroscope sensor.
* android.hardware.sensor.gyroscope 应用程序使用设备的陀螺仪感应器。
* android.hardware.sensor.light The application uses the device's light sensor.
* android.hardware.sensor.light 应用程序使用设备的光感应器。
* android.hardware.sensor.proximity The application uses the device's proximity sensor.
* android.hardware.sensor.proximity 应用程序使用设备的接近感应器。
* Screen
* 屏幕
* android.hardware.screen.landscape The application requires landscape orientation.
* android.hardware.screen.landscape 应用程序需要宽屏方向。
* android.hardware.screen.portrait The application requires portrait orientation.
* android.hardware.screen.portrait 应用程序需要竖屏方向。
For example, if your app requires portrait orientation, you should declare <uses-feature android:name="android.hardware.screen.portrait"/> so that only devices that support portrait orientation (whether always or by user choice) can install your app. If your application supports both orientations, then you don't need to declare either.
例如,如果你的应用需要竖屏方向,那么你应该声明<uses-feature android:name="android.hardware.screen.portrait"/>以使只有支持竖屏方向的设备(不管总是或者通过用户选择)才可以安装你的应用。如果你的应用程序都支持两种方向,那么你不需要声明任何一个。
Both orientations are assumed not required, by default, so your app may be installed on devices that support one or both orientations. However, if any of your activities request that they run in a specific orientation, using the android:screenOrientation attribute, then this also declares that the application requires that orientation. For example, if you declare android:screenOrientation with either "landscape", "reverseLandscape", or "sensorLandscape", then your application will be available only to devices that support landscape orientation. As a best practice, you should still declare your requirement for this orientation using a <uses-feature> element. If you declare an orientation for your activity using android:screenOrientation, but don't actually require it, you can disable the requirement by declaring the orientation with a <uses-feature> element and include android:required="false".
默认下假设两个方向是不需要的,所以你的应用可能被安装在支持一个或两个方向的设备上。然而,如果你的活动中任意一个请求它们运行在一个特定的方向中,使用android:screenOrientation属性,那么它也声明了应用程序需要那个方向。例如,如果你用"landscape","reverseLandscape",或"sensorLandscape"之一声明android:screenOrientation,然后你的应用程序将只对于支持宽屏方向的设备是可用的。作为一条最佳实践,你应该仍然使用<uses-feature>元素声明你对这个方向的要求。如果你为你的活动使用android:screenOrientation声明一个方向,但不是真的需要它,那么你可以通过用<uses-feature>元素声明方向以及包含android:required="false"来屏蔽这个要求。
For backwards compatibility, any device running a platform version that supports only API level 12 or lower is assumed to support both landscape and portrait.
为了向后兼容性,假设运行只支持API级别12或更低平台版本的任意设备都支持宽屏和竖屏。
* Telephony
* 电话
* android.hardware.telephony The application uses telephony features on the device, such as telephony radio with data communication services.
* android.hardware.telephony 应用程序使用设备上的电话特性,诸如带数据通信服务的电话无线通信。
* android.hardware.telephony.cdma Subfeature. The application uses CDMA telephony radio features on the device.
* android.hardware.telephony.cdma 子特性。应用程序使用设备上的CDMA(注:Code Division Multiple Access,码分多址)电话无线特性。
* android.hardware.telephony.gsm Subfeature. The application uses GSM telephony radio features on the device.
* android.hardware.telephony.gsm 子特性。应用程序使用设备上的GSM(注:Global System of Mobile communication,全球移动通信系统)电话无线特性。
These subfeatures implicitly declare the android.hardware.telephony parent feature, unless declared with android:required="false".
这些子特性隐式地声明android.hardware.telephony父特性,除非用android:required="false"声明它。(注:这是cdma、gsm这两个子特性的注释)
* Touchscreen
* 触摸屏
* android.hardware.faketouch The application uses basic touch interaction events, such as "click down", "click up", and drag.
* android.hardware.faketouch 应用程序使用基本触摸交互事件,诸如“点击向下”,“点击向上”,和拖动。
When declared as required, this indicates that the application is compatible with a device only if it offers an emulated touchscreen ("fake touch" interface), or better. A device that offers a fake touch interface provides a user input system that emulates a subset of touchscreen capabilities. For example, a mouse or remote control that drives an on-screen cursor provides a fake touch interface. If your application requires basic point and click interaction (in other words, it won't work with only a d-pad controller), you should declare this feature. Because this is the minimum level of touch interaction, your app will also be compatible with devices that offer more complex touch interfaces.
当它被声明为必需的时,这指示应用程序兼容一台设备,仅当它提供一个模拟的触摸屏(“伪触摸”界面),或更好的。一台提供伪触摸界面的设备提供一个用户输入系统,它模拟触摸屏功能的一个子集。例如,驱动屏幕上光标的鼠标或远程控制提供一个伪触摸界面。如果你的应用程序需要基本的点和点击交互(换言之,它将不工作于只有一个方向板控制器),你应该声明此特性。因为这是触摸交互的最小级别,所以你的应用还将兼容提供更多复杂触摸界面的设备。
-------------------------------
Note: Because applications require the android.hardware.touchscreen feature by default, if you want your application to be available to devices that provide a fake touch interface, you must also explicitly declare that a touch screen is not required by declaring <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
注意:因为应用程序默认需要android.hardware.touchscreen,如果你希望你的应用程序对于提供一个伪触摸界面的设备是可用的,那么你还必须通过声明<uses-feature android:name="android.hardware.touchscreen" android:required="false" />来显式地声明触摸屏是非必需的。
-------------------------------
* android.hardware.faketouch.multitouch.distinct The application performs distinct tracking of two or more "fingers" on a fake touch interface. This is a superset of the faketouch feature.
* android.hardware.faketouch.multitouch.distinct 应用程序执行不同的在一个伪触摸界面上两个或多个“手指”跟踪。这是faketouch特性的超集。
When declared as required, this indicates that the application is compatible with a device only if it supports touch emulation for events that supports distinct tracking of two or more fingers, or better.
当被声明为必需时,这指示应用程序兼容一个设备,仅当它支持触碰模拟以获得支持两个或多个手指的区分跟踪(注:轨迹)的事件,或者更好的。
Unlike the distinct multitouch defined by android.hardware.touchscreen.multitouch.distinct, input devices that support distinct multi-touch with a fake touch interface will not support all two-finger gestures, because the input is being transformed to cursor movement on the screen. That is, single finger gestures on such a device move a cursor; two-finger swipes will result in single-finger touch events; other two-finger gestures will result in the corresponding two-finger touch event. An example device that supports distinct multi-touch with a fake touch interface is one that provides a trackpad for cursor movement which also supports two or more fingers.
不像被android.hardware.touchscreen.multitouch.distinct定义的区分多触碰那样,用一个伪触碰界面支持区分多点触碰的输入设备将不支持所有的两手指手势,因为输入正在被转换为屏幕上的光标移动。就是说,在这样的设备上单一手指手势移动光标;两手指轻扫将导致单一手指的触碰事件;其它两手指手势将导致相应的两手指触碰事件。用伪触碰界面支持区分多点触碰的一个示例设备是提供轨迹板用于光标移动的设备,它也支持两个或多个手指。
* android.hardware.faketouch.multitouch.jazzhand The application performs distinct tracking of five or more "fingers" on a fake touch interface. This is a superset of the faketouch feature.
* android.hardware.faketouch.multitouch.jazzhand 应用程序在一个伪触摸界面上执行不同的五个或多个“手指”跟踪。这是faketouch特性的超集。
When declared as required, this indicates that the application is compatible with a device only if it supports touch emulation for events that supports distinct tracking of five or more fingers.
当声明为必需的时,它指示应用程序兼容一个设备,仅当它支持对支持五个或多个手指的区分跟踪事件的触摸模拟。
Unlike the distinct multitouch defined by android.hardware.touchscreen.multitouch.jazzhand, input devices that support jazzhand multi-touch with a fake touch interface will not support all five-finger gestures, because the input is being transformed to cursor movement on the screen. That is, single finger gestures on such a device move a cursor; multi-finger gestures will result in single-finger touch events; other multi-finger gestures will result in the corresponding multi-finger touch event. An example device that supports distinct multi-touch with a fake touch interface is one that provides a trackpad for cursor movement which also supports five or more fingers.
不像被android.hardware.touchscreen.multitouch.jazzhand定义的区分的多触碰那样,用一个伪触碰界面支持jazzhand多点触碰的输入设备将不支持所有五个手指的动作,因为输入正在被转换为屏幕上的光标移动。就是说,在这样的设备上的单一手指动作移动一个光标;多手指动作将导致一个单手指触摸事件;其它多手指手势将导致相应的多手指触摸事件。用一个伪触碰界面支持区分的多触碰的一个示例设备是提供一个用于光标移动的轨迹板的设备,它也支持五个或更多手指。
* android.hardware.touchscreen The application uses touchscreen capabilities for gestures that are more interactive than basic touch events, such as a fling. This is a superset of the basic faketouch feature.
* android.hardware.touchscreen 应用程序使用触摸屏功能以获得比基本触摸事件更具交互性的手势,诸如轻扫(注:fling原意是投掷)。这是基本faketouch特性的超集。
By default, your application requires this. As such, your application is not available to devices that provide only an emulated touch interface ("fake touch"), by default. If you want your application available to devices that provide a fake touch interface (or even devices that provide only a d-pad controller), you must explicitly declare that a touch screen is not required, by declaring android.hardware.touchscreen with android:required="false". You should do so even if your application uses—but does not require—a real touch screen interface.
默认,你的应用需要它。同样,默认下你的应用程序对于只提供一个模拟触摸界面(“伪触摸”)的设备来说是不可用的。如果你希望你的应用程序可用于提供一个伪触摸界面的设备(或者甚至是只提供方向板控制器的设备),你必须显式地声明触摸屏不是必需的,通过用android:required="false"声明android.hardware.touchscreen。你应该这样做,即便你的应用程序使用了——但不是必需的——一个真正的触摸屏界面。
If your application does require a touch interface (in order to perform touch gestures such as a fling), then you don't need to do anything, because this is required by default. However, it's best if you explicitly declare all features used by your application, so you should still declare this if your app uses it.
如果你的应用程序需要一个触摸屏界面(为了执行触摸动作诸如轻扫),然后你不需要做任何事情,因为默认这是必需的。然而,如果你显式地声明你的应用程序使用的所有特性就最好了,所以你仍然应该声明它如果你的应用使用了它。
If you require more complex touch interaction, such as multi-finger gestures, you should declare the advanced touch screen features below.
如果你需要更复杂的触碰交互,诸如多手指动作,你应该声明下面的高级触摸屏特性。
* android.hardware.touchscreen.multitouch The application uses basic two-point multitouch capabilities on the device screen, such as for pinch gestures, but does not need to track touches independently. This is a superset of touchscreen feature.
* android.hardware.touchscreen.multitouch 应用程序使用设备屏幕上基本的两点触碰功能,诸如用于捏手势,但不需要独立地跟踪触碰。这是触摸屏特性的超集。
This implicitly declares the android.hardware.touchscreen parent feature, unless declared with android:required="false".
这隐式地声明android.hardware.touchscreen父特性,除非用android:required="false"声明它。(注:这是multitouch的注释)
* android.hardware.touchscreen.multitouch.distinct Subfeature. The application uses advanced multipoint multitouch capabilities on the device screen, such as for tracking two or more points fully independently. This is a superset of multitouch feature.
* android.hardware.touchscreen.multitouch.distinct 子特性。应用程序使用设备屏幕上高级多点多触碰功能,诸如用于完全独立地跟踪两个或多个点。这是多触碰特性的超集。
* android.hardware.touchscreen.multitouch.jazzhand The application uses advanced multipoint multitouch capabilities on the device screen, for tracking up to five points fully independently. This is a superset of distinct multitouch feature.
* android.hardware.touchscreen.multitouch.jazzhand 应用程序使用设备屏幕上的高级多点多触碰功能,用于完全独立地跟踪多至五点。这是区分的多触碰特性的超集。(注:Jazz hands应该是指一种舞蹈手势)
This implicitly declares the android.hardware.touchscreen.multitouch parent feature, unless declared with android:required="false".
这隐式地声明android.hardware.touchscreen.multitouch父特性,除非用android:required="false"声明它。(注:这是distinct和jazzhand的注释)
* USB
* USB
* android.hardware.usb.host The application uses USB host mode features (behaves as the host and connects to USB devices).
* android.hardware.usb.host 应用程序使用USB主机模式特性(行为如同主机并且连接到USB设备上)
* android.hardware.usb.accessory The application uses USB accessory features (behaves as the USB device and connects to USB hosts).
* android.hardware.usb.accessory 应用程序使用USB附件特性(行为如同USB设备并且连接到USB主机上)。
* Wifi
* Wifi(注:wireless fidelity的缩写)
* android.hardware.wifi The application uses 802.11 networking (wifi) features on the device.
* android.hardware.wifi 应用程序使用设备上的802.11网络(wifi)特性。
-------------------------------
Software features
软件特性
The table below describes the software feature descriptors supported by the most current platform release. To signal that your application uses or requires a software feature, declare each value in a android:name attribute in a separate <uses-feature> element.
下面的表格描述当前大多数平台发布版支持的软件特性描述符。为了通知你的应用程序使用或需要一个软件特性,请在单独的<uses-feature>元素的android:name属性中声明每个值。
-------------------------------
* Feature Attribute Value Description Comments
* 特性 属性值 描述 注释
* Live Wallpaper
* 动态壁纸
* android.software.live_wallpaper The application uses or provides Live Wallpapers.
* android.software.live_wallpaper 应用程序使用或提供动态壁纸
* SIP/VOIP
* SIP/VOIP(注:SIP是Session Initiation Protocol的缩写,会话发起协议,是用于VoIP最主要的信令协议之一。VOIP是Voice over Internet Protocol的缩写,意思是IP电话或网络电话)
* android.software.sip The application uses SIP service on the device.
* android.software.sip 应用程序使用设备上的SIP服务。
* android.software.sip.voip Subfeature. The application uses SIP-based VOIP service on the device.
* android.software.sip.voip 子特性。应用程序使用设备上基于SIP的VOIP服务。
This subfeature implicitly declares the android.software.sip parent feature, unless declared with android:required="false".
这个子特性隐式地声明android.software.sip父特性,除非用android:required="false"来声明。
-------------------------------
Permissions that Imply Feature Requirements
暗示特性要求的权限
Some feature constants listed in the tables above were made available to applications after the corresponding API; for example, the android.hardware.bluetooth feature was added in Android 2.2 (API level 8), but the bluetooth API that it refers to was added in Android 2.0 (API level 5). Because of this, some apps were able to use the API before they had the ability to declare that they require the API via the <uses-feature> system.
一些列举在上面表格中的特性常量被变成在对应的API后(注:API级别后?)对应用程序可用;例如,android.hardware.bluetooth,android.hardware.bluetooth特性在Android 2.2中(API级别8)被添加,但它引用的蓝牙API在Android 2.0(API级别5)中被添加。因此,一些应用在它们有能力通过<uses-feature>系统声明它们需要该API之前,有能力使用该API。
To prevent those apps from being made available unintentionally, Android Market assumes that certain hardware-related permissions indicate that the underlying hardware features are required by default. For instance, applications that use Bluetooth must request the BLUETOOTH permission in a <uses-permission> element — for legacy apps, Android Market assumes that the permission declaration means that the underlying android.hardware.bluetooth feature is required by the application and sets up filtering based on that feature.
为了阻止那些应用非故意地变得可用,Android市场假设某个硬件相关权限指示底层硬件特性默认是必需的。例如,使用蓝牙的应用程序必须在<uses-permission>元素中请求BLUETOOTH权限——对于遗留的应用,Android市场假设权限声明意味着底层android.hardware.bluetooth特性是应用程序需要的并且配置基于那个特性的过滤。
The table below lists permissions that imply feature requirements equivalent to those declared in <uses-feature> elements. Note that <uses-feature> declarations, including any declared android:required attribute, always take precedence over features implied by the permissions below.
下面的表格列出暗示了特性要求等价于声明在<uses-feature>元素中的那些特性要求的权限。注意<uses-feature>声明,包括任意被声明了的android:required属性,总是持有比下面权限暗示的特性要高的优先级。
For any of the permissions below, you can disable filtering based on the implied feature by explicitly declaring the implied feature explicitly, in a <uses-feature> element, with an android:required="false" attribute. For example, to disable any filtering based on the CAMERA permission, you would add this <uses-feature> declaration to the manifest file:
对于以下任意权限,你可以通过显式声明(注:此处多了一个explicitly)带android:required="false"属性的被暗示特性来屏蔽基于被暗示特性的过滤。例如,为了屏蔽基于CAMERA权限的任意过滤,你应该添加这个<uses-feature>声明到清单文件:
-------------------------------
<uses-feature android:name="android.hardware.camera" android:required="false" />
-------------------------------
-------------------------------
* Category This Permission... Implies This Feature Requirement
* 分类 这个权限是…… 暗示这个特性要求(注:此表内的缩写含义暂时不翻译)
* Bluetooth
* 蓝牙
* BLUETOOTH android.hardware.bluetooth
(See Special handling for Bluetooth feature for details.) (详细请见对蓝牙特性的特殊处理。)
* BLUETOOTH_ADMIN android.hardware.bluetooth
* Camera
* 照相机
* CAMERA android.hardware.camera and
android.hardware.camera.autofocus
* Location
* 位置
* ACCESS_MOCK_LOCATION android.hardware.location
* ACCESS_LOCATION_EXTRA_COMMANDS android.hardware.location
* INSTALL_LOCATION_PROVIDER android.hardware.location
* ACCESS_COARSE_LOCATION android.hardware.location.network and
android.hardware.location
* ACCESS_FINE_LOCATION android.hardware.location.gps and
android.hardware.location
* Microphone
* 麦克风
* RECORD_AUDIO android.hardware.microphone
* Telephony
* 电话
* CALL_PHONE android.hardware.telephony
* CALL_PRIVILEGED android.hardware.telephony
* MODIFY_PHONE_STATE android.hardware.telephony
* PROCESS_OUTGOING_CALLS android.hardware.telephony
* READ_SMS android.hardware.telephony
* RECEIVE_SMS android.hardware.telephony
* RECEIVE_MMS android.hardware.telephony
* RECEIVE_WAP_PUSH android.hardware.telephony
* SEND_SMS android.hardware.telephony
* WRITE_APN_SETTINGS android.hardware.telephony
* WRITE_SMS android.hardware.telephony
* Wifi
* 无线宽带
* ACCESS_WIFI_STATE android.hardware.wifi
* CHANGE_WIFI_STATE android.hardware.wifi
* CHANGE_WIFI_MULTICAST_STATE android.hardware.wifi
-------------------------------
Except as noted, this content is licensed under Apache 2.0. For details and restrictions, see the Content License.
除特别说明外,本文在Apache 2.0下许可。细节和限制请参考内容许可证。
Android 4.0 r1 - 14 Feb 2012 21:12
-------------------------------
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
(此页部分内容基于Android开源项目,以及使用根据创作公共2.5来源许可证描述的条款进行修改)
(本人翻译质量欠佳,请以官方最新内容为准,或者参考其它翻译版本:
* ソフトウェア技術ドキュメントを勝手に翻訳
http://www.techdoctranslator.com/android
* Ley's Blog
http://leybreeze.com/blog/
* 农民伯伯
http://www.cnblogs.com/over140/
* Android中文翻译组
http://androidbox.sinaapp.com/
)
发表评论
-
【翻译】(9-补丁2)电话簿提供者
2012-07-18 12:54 2400【翻译】(9-补丁2)电话簿提供者 see h ... -
【翻译】(8-补丁1)Android接口定义语言(AIDL)
2012-07-02 05:55 2927【翻译】(8-补丁1)Andro ... -
【翻译】(0)应用组件
2012-06-30 23:50 829【翻译】(0)应用组件 see http:// ... -
【翻译】(88)传感器
2012-05-21 21:25 1078【翻译】(88)传感器 ... -
【翻译】(87)复制与粘贴
2012-05-20 14:48 1929【翻译】(87)复制与粘贴 see http: ... -
【翻译】(86)音频捕捉
2012-05-16 15:14 1104【翻译】(86)音频捕捉 ... -
【翻译】(85)照相机
2012-05-13 15:09 3796【翻译】(85)照相机 see http:// ... -
【翻译】(84)JetPlayer
2012-04-21 16:24 981【翻译】(84)JetPlayer see h ... -
【翻译】(83)媒体回放
2012-04-21 16:00 1860【翻译】(83)媒体回放 see http:/ ... -
【翻译】(82)多媒体与照相机
2012-04-18 23:05 953【翻译】(82)多媒体与照相机 see htt ... -
【翻译】(23-补丁3)构建无障碍服务
2012-04-18 21:57 1627【翻译】(23-补丁3)构 ... -
【翻译】(23-补丁2)使应用程序无障碍
2012-04-16 13:08 2099【翻译】(23-补丁2)使应用程序无障碍 see ... -
【翻译】(23-补丁1)无障碍
2012-04-11 22:38 911【翻译】(23-补丁1)无 ... -
【翻译】(81)Renderscript之运行时API参考手册
2012-04-11 22:13 1416【翻译】(81)Renderscript之运行时API参 ... -
【翻译】(80)Renderscript之计算
2012-04-09 14:09 1444【翻译】(80)Renderscript之计算 ... -
【翻译】(79)Renderscript之图形
2012-04-08 13:59 2866【翻译】(79)Renderscript之图形 ... -
【翻译】(78)Renderscript
2012-04-04 15:35 1442【翻译】(78)Renderscript see ... -
【翻译】(77)可绘画对象动画
2012-03-18 10:52 711【翻译】(77)可绘画对象动画 see htt ... -
【翻译】(76)视图动画
2012-03-18 10:04 806【翻译】(76)视图动画 see http:/ ... -
【翻译】(75)属性动画
2012-03-17 18:24 2508【翻译】(75)属性动画 see http:/ ...
相关推荐
`<uses-feature>` 元素通常包含以下属性: 1. `android:name`:此属性定义了所需功能的名称,它是一个字符串,例如 `"android.hardware.touchscreen.multitouch"` 表示多点触控屏幕。功能名称可以是Android官方定义...
本文将深入探讨 `<uses-feature>` 和 `<uses-permission>` 元素,帮助开发者更好地理解和使用它们。 首先,`<uses-feature>` 元素用于声明应用程序所依赖的特定硬件或软件功能。这对于在Google Play商店发布应用时...
<uses-feature android:name="android.hardware.camera" android:required="false" /> <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" /> <uses-feature ...
`ACCESS_FINE_LOCATION`权限是获取精确位置信息(如经纬度)所必需的,而`uses-feature`标签则表明应用需要GPS硬件支持。 接下来,我们创建一个Activity,例如`MainActivity`,并添加一个按钮用于触发获取经纬度的...
Recorder 参考微信实现的短视频录像 allprojects { repositories { ... ... } } dependencies { ...<uses-permission android:name="android.permission.RECORD_AUDIO...<uses-feature android:name="android.hardware.c
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission....
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"> </uses-permission><uses-permission android:name="android.permission.INTERNET"> </uses-permission><uses-permission android:name=...
虽然Android没有明确指定uses-permission不可以重复写,但是最近的经验是最好是不要重复,否则在某些厂商定制的技巧可能出现问题。 最近写一个应用,里面有用到网络访问,发现在有些机型下总是访问不了网络。而其他...
<uses-feature android:name="android.hardware.camera"/> <uses-feature android:name="android.hardware.camera.autofocus"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> ...
在Android应用开发中,`AndroidManifest.xml` 文件是至关重要的,因为它包含了应用程序的元数据,包括对`uses-sdk`标签的定义。`uses-sdk`标签用于指定应用支持的Android SDK版本,这对于应用的兼容性和性能至关重要...
<uses-permission android:name="android.permission.CALL_PHONE" /> <uses-permission android:name="android.permission.READ_CONTACTS" /> <uses-permission android:name="android.permission.WRITE_CONTACTS...
<uses-feature android:glEsVersion="0x00020000" android:required="true"/> Step 1 mFilterManager = FilterManager .builder() .context(mApplicationContext) .isUseQiniu(false)//是否在qiniu云直播上...
<uses-permission android:name="android.permission.SEND_SMS"></uses-permission> <uses-permission android:name="android.permission.READ_SMS"></uses-permission> <uses-permission android:name="android....
<uses-feature android:glEsVersion="0x00020000" android:required="true" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.WRITE_...
一、关于AndroidManifest.xml AndroidManifest.xml 是每个android程序中必须的文件。它位于整个项目的根目录,描述了package中暴露的组件(activities, services... <uses-feature/> <supports-screens/> </manifest>
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android....