【通译】(65)uses-configuration元素

【翻译】(65)uses-configuration元素

【翻译】(65)uses-configuration元素

 

see

http://developer.android.com/guide/topics/manifest/uses-configuration-element.html

 

原文见

http://developer.android.com/guide/topics/manifest/uses-configuration-element.html

 

-------------------------------

 

<uses-configuration>

 

uses-configuration元素

 

-------------------------------

 

* syntax:

 

* 语法:

 

-------------------------------

 

<uses-configuration android:reqFiveWayNav=["true" | "false"] 

                    android:reqHardKeyboard=["true" | "false"]

                    android:reqKeyboardType=["undefined" | "nokeys" | "qwerty" |  

                                             "twelvekey"]

                    android:reqNavigation=["undefined" | "nonav" | "dpad" | 

                                           "trackball" | "wheel"]

                    android:reqTouchScreen=["undefined" | "notouch" | "stylus" | 

                                            "finger"] />

 

-------------------------------

 

* contained in:

 

* 被包含在:

 

<manifest>

 

* description:

 

* 描述:

 

Indicates what hardware and software features the application requires. For example, an application might specify that it requires a physical keyboard or a particular navigation device, like a trackball. The specification is used to avoid installing the application on devices where it will not work.

 

指示该应用程序需要什么硬件和软件特性。例如,一个应用程序可能指定它需要一个物理键盘或一个特殊的导航设备,像一个轨迹球。使用此规范来避免在它不能运行在的设备上安装该应用程序。

 

If an application can work with different device configurations, it should include separate <uses-configuration> declarations for each one. Each declaration must be complete. For example, if an application requires a five-way navigation control, a touch screen that can be operated with a finger, and either a standard QWERTY keyboard or a numeric 12-key keypad like those found on most phones, it would specify these requirements with two <uses-configuration> elements as follows:

 

如果一个应用程序可以应付不同设备配置,那么它应该为每个配置包含分离的<uses-configuration>声明。每个声明必须是完整的。例如,如果一个应用程序需要一个五方向的导航控制,一个可以用手指操作的触摸屏,以及一个标准QWERTY键盘(注:就是指平时PC机用的那种键盘)或一个像在大多数电话上找到的那种数字12键的数字键盘,那么它会用两个<uses-configuration>元素指定这些需求,如下:

 

-------------------------------

 

<uses-configuration android:reqFiveWayNav="true" android:reqTouchScreen="finger"

                    android:reqKeyboardType="qwerty" />

<uses-configuration android:reqFiveWayNav="true" android:reqTouchScreen="finger"

                    android:reqKeyboardType="twelvekey" />

 

-------------------------------

 

* attributes:

 

* 属性:

 

* android:reqFiveWayNav

 

Whether or not the application requires a five-way navigation control — "true" if it does, and "false" if not. A five-way control is one that can move the selection up, down, right, or left, and also provides a way of invoking the current selection. It could be a D-pad (directional pad), trackball, or other device.

 

应用程序是否需要一个五方向导航控制——"true"如果它需要,而"false"如果它不需要。一个五方向控制是指可以把选择向上,向下,向右,或向左移动,并且还提供一种方式调用当前的选择。它可以是一个D-pad(方向板),轨迹球,或其它设备。

 

If an application requires a directional control, but not a control of a particular type, it can set this attribute to "true" and ignore the reqNavigation attribute. However, if it requires a particular type of directional control, it can ignore this attribute and set reqNavigation instead.

 

如果一个应用程序需要一个方向控制,但不是一种特定类型的控制,那么它可以设置这个属性为"true"并且忽略reqNavigation属性。然而,如果它需要一种方向控制的特定类型,那么可以忽略此属性并且改为设置reqNavigation属性。

 

* android:reqHardKeyboard

 

Whether or not the application requires a hardware keyboard — "true" if it does, and "false" if not.

 

应用程序是否需要一个硬件键盘——"true"如果它需要,而"false"如果不需要。

 

* android:reqKeyboardType

 

The type of keyboard the application requires, if any at all. This attribute does not distinguish between hardware and software keyboards. If a hardware keyboard of a certain type is required, specify the type here and also set the reqHardKeyboard attribute to "true".

 

应用程序必需的键盘的类型,如果有的话。这个属性没有区分硬键盘和软键盘。如果某类型的硬键盘是必需的,在这里指定该类型,同时还也设置reqHardKeyboard为"true"。

 

The value must be one of the following strings:

 

值必须是以下字符串之一:

 

-------------------------------

 

* Value Description

 

* 值 描述

 

* "undefined" The application does not require a keyboard. (A keyboard requirement is not defined.) This is the default value.

 

* "undefined" 应用程序不需要键盘。(键盘要求没有被定义。)这是默认值。

 

* "nokeys" The application does not require a keyboard.

 

* "nokeys" 应用程序不需要键盘。

 

* "qwerty" The application requires a standard QWERTY keyboard.

 

* "qwerty" 应用程序需要一个标准QWERTY键盘。

 

* "twelvekey" The application requires a twelve-key keypad, like those on most phones — with keys for the digits from 0 through 9 plus star (*) and pound (#) keys.

 

* "twelvekey" 应用程序需要一个12键键盘,像大多数电话上的那样——带有表示从0到9的数字加上星号(*)和井号(#)键的按键。

 

-------------------------------

 

* android:reqNavigation

 

The navigation device required by the application, if any. The value must be one of the following strings:

 

应用程序必需的导航设备,如果有的话。值必须是以下字符串之一:

 

-------------------------------

 

* Value Description

 

* 值 描述

 

* "undefined" The application does not require any type of navigation control. (The navigation requirement is not defined.) This is the default value.

 

* "undefined" 应用程序不需要任意导航控制类型。(导航要求没有被定义。)这是默认值。

 

* "nonav" The application does not require a navigation control.

 

* "nonav" 应用程序不需要一个导航控制。

 

* "dpad" The application requires a D-pad (directional pad) for navigation.

 

* "dpad" 应用程序需要一个D-pad(方向板)用于导航。

 

* "trackball" The application requires a trackball for navigation.

 

* "trackball" 应用程序需要一个轨迹球用于导航

 

* "wheel" The application requires a navigation wheel.

 

* "wheel" 应用程序需要一个导航滚轮。

 

-------------------------------

 

If an application requires a navigational control, but the exact type of control doesn't matter, it can set the reqFiveWayNav attribute to "true" rather than set this one.

 

如果一个应用程序需要一个导航控制,但具体的控制类型不要紧,那么可以设置reqFiveWayNav属性为"true"而非设置这个属性。

 

* android:reqTouchScreen

 

The type of touch screen the application requires, if any at all. The value must be one of the following strings:

 

应用程序需要的触摸屏的类型,如果有的话。该值必须是以下字符串之一:

 

-------------------------------

 

* Value Description

 

* 值 描述

 

* "undefined" The application doesn't require a touch screen. (The touch screen requirement is undefined.) This is the default value.

 

* "undefined" 应用程序不需要一个触摸屏。(触摸屏要求是未定义的。)这是默认值。

 

* "notouch" The application doesn't require a touch screen.

 

* "notouch" 应用程序不需要一个触摸屏。

 

* "stylus" The application requires a touch screen that's operated with a stylus.

 

* "stylus" 应用程序需要一个触摸屏,它用手写笔来操作。

 

* "finger" The application requires a touch screen that can be operated with a finger.

 

* "finger" 应用程序需要一个触摸屏,它可以用手指来操作。

 

-------------------------------

 

* introduced in:

 

* 引入:

 

API Level 3

 

API级别3

 

* see also:

 

* 另见:

 

* configChanges attribute of the <activity> element <activity>元素的configChanges属性

* ConfigurationInfo

 

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/