- cú pháp:
<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"] />
- có trong:
<manifest>
- mô tả:
Cho biết ứng dụng yêu cầu tính năng phần cứng và phần mềm nào. Ví dụ: một ứng dụng có thể chỉ định là yêu cầu bàn phím thực hoặc một thiết bị điều hướng cụ thể, chẳng hạn như bi xoay. Thông số kỹ thuật được dùng để tránh việc cài đặt ứng dụng trên các thiết bị không hỗ trợ.
Lưu ý: Hầu hết ứng dụng không dùng thẻ tệp kê khai này. Luôn hỗ trợ phương thức nhập bằng bàn phím di chuyển (D-pad) để trợ giúp người dùng khiếm thị và hỗ trợ các thiết bị có phương thức nhập bằng D-pad bên cạnh phương thức chạm hoặc thay thế phương thức chạm.
Để biết thông tin về cách hỗ trợ phương thức nhập bằng D-pad trong ứng dụng, hãy đọc bài viết Xử lý thao tác của bộ điều khiển. Nếu ứng dụng của bạn hoàn toàn không hoạt động được nếu không có màn hình cảm ứng, hãy sử dụng thẻ
<uses-feature>
để khai báo loại màn hình cảm ứng bắt buộc, từ"android.hardware.faketouch"
cho sự kiện cảm ứng cơ bản đến các loại màn hình cảm ứng nâng cao hơn như"android.hardware.touchscreen.multitouch.jazzhand"
để nhập dữ liệu riêng biệt từ nhiều ngón tay.- thuộc tính:
android:reqFiveWayNav
- Ứng dụng có yêu cầu chức năng điều khiển thao tác 5 chiều hay không. Nếu có, giá trị sẽ là
"true"
và nếu không, giá trị sẽ là"false"
. Chức năng điều khiển 5 chiều có thể di chuyển nội dung được chọn theo chiều lên, xuống, sang phải hoặc sang trái, đồng thời cho phép gọi lựa chọn hiện tại. Đó có thể là bàn phím di chuyển (D-pad), bi xoay hoặc thiết bị khác.Nếu yêu cầu chức năng điều khiển chiều nhưng không yêu cầu loại cụ thể nào, thì ứng dụng có thể đặt thuộc tính này thành
"true"
và bỏ qua thuộc tínhreqNavigation
. Tuy nhiên, nếu yêu cầu một loại chức năng điều khiển chiều cụ thể, thì ứng dụng có thể bỏ qua thuộc tính này và đặtreqNavigation
. android:reqHardKeyboard
- Ứng dụng có yêu cầu bàn phím phần cứng hay không. Nếu có, giá trị sẽ là
"true"
và nếu không, giá trị sẽ là"false"
. android:reqKeyboardType
- Loại bàn phím mà ứng dụng yêu cầu, nếu có.
Thuộc tính này không phân biệt giữa bàn phím phần cứng và bàn phím phần mềm. Nếu ứng dụng yêu cầu bàn phím phần cứng thuộc một loại nhất định, hãy chỉ định loại đó tại đây, đồng thời đặt thuộc tính
reqHardKeyboard
thành"true"
.Giá trị phải là một trong các chuỗi sau:
Giá trị Mô tả " undefined
"Ứng dụng không yêu cầu bàn phím. Không xác định thông tin yêu cầu bàn phím. Đây là giá trị mặc định. " nokeys
"Ứng dụng không yêu cầu bàn phím. " qwerty
"Ứng dụng cần bàn phím QWERTY tiêu chuẩn. " twelvekey
"Ứng dụng yêu cầu một bàn phím gồm 12 phím, giống như trên đa số điện thoại, có các phím cho chữ số từ 0
đến9
cùng dấu sao (*
) và dấu thăng (#
). android:reqNavigation
- Thiết bị điều hướng mà ứng dụng yêu cầu, nếu có. Giá trị phải là một trong các chuỗi sau:
Giá trị Mô tả " undefined
"Ứng dụng không yêu cầu bất kỳ loại chức năng điều khiển thao tác nào. Không xác định thông tin yêu cầu điều hướng. Đây là giá trị mặc định. " nonav
"Ứng dụng không yêu cầu chức năng điều khiển thao tác. " dpad
"Ứng dụng yêu cầu dùng D-pad để điều hướng. " trackball
"Ứng dụng cần có bi xoay để điều hướng. " wheel
"Ứng dụng yêu cầu bi lăn điều hướng. Nếu yêu cầu chức năng điều khiển thao tác nhưng không yêu cầu loại cụ thể nào, thì ứng dụng có thể đặt thuộc tính
reqFiveWayNav
thành"true"
thay vì đặt thuộc tính này. android:reqTouchScreen
- Loại màn hình cảm ứng mà ứng dụng yêu cầu, nếu có.
Giá trị phải là một trong các chuỗi sau:
Giá trị Mô tả " undefined
"Ứng dụng không yêu cầu màn hình cảm ứng. Không xác định thông tin yêu cầu màn hình cảm ứng. Đây là giá trị mặc định. " notouch
"Ứng dụng không yêu cầu màn hình cảm ứng. " stylus
"Ứng dụng yêu cầu một màn hình cảm ứng hoạt động với bút cảm ứng. " finger
"Ứng dụng yêu cầu một màn hình cảm ứng hoạt động bằng ngón tay. Lưu ý: Nếu ứng dụng của bạn yêu cầu phương thức nhập bằng cách chạm, bạn nên dùng thẻ
<uses-feature>
để khai báo loại màn hình cảm ứng cần có, bắt đầu bằng"android.hardware.faketouch"
cho các sự kiện cảm ứng cơ bản.
- ra mắt từ:
- API cấp 3
- xem thêm:
-
- thuộc tính
configChanges
của phần tử<activity>
ConfigurationInfo
- thuộc tính
<uses-cấu hình>
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],null,["# <uses-configuration\u003e\n\nsyntax:\n:\n\n ```xml\n \u003cuses-configuration\n android:reqFiveWayNav=[\"true\" | \"false\"]\n android:reqHardKeyboard=[\"true\" | \"false\"]\n android:reqKeyboardType=[\"undefined\" | \"nokeys\" | \"qwerty\" | \"twelvekey\"]\n android:reqNavigation=[\"undefined\" | \"nonav\" | \"dpad\" | \"trackball\" | \"wheel\"]\n android:reqTouchScreen=[\"undefined\" | \"notouch\" | \"stylus\" | \"finger\"] /\u003e\n ```\n\ncontained in:\n: [\u003cmanifest\u003e](/guide/topics/manifest/manifest-element)\n\ndescription:\n\n: Indicates the hardware and software features the application requires.\n For example, an application might specify that it requires a physical keyboard\n or a particular navigation device, like a trackball. The specification is\n used to avoid installing the application on devices where it doesn't work.\n\n **Note:** Most apps don't use this manifest tag.\n *Always* support input with a directional pad (D-pad) to assist sight-impaired\n users and support devices that provide D-pad input in addition to or instead of touch.\n\n For\n information about how to support D-pad input in your app, read [Handle controller actions](/develop/ui/views/touch-and-input/game-controllers/controller-input). If\n your app absolutely can't function without a touchscreen, then instead use the [`\u003cuses-feature\u003e`](/guide/topics/manifest/uses-feature-element) tag to\n declare the required touchscreen type, ranging from `\"android.hardware.faketouch\"` for basic\n touch-style events to more advanced touch types such as `\"android.hardware.touchscreen.multitouch.jazzhand\"` for distinct input from multiple fingers.\n\nattributes:\n:\n\n `android:reqFiveWayNav`\n : Whether the application requires a five-way navigation control. It's\n `\"true\"` if it does, and `\"false\"` if not. A five-way\n control is one that can move the selection up, down, right, or left, and\n also provides a way of invoking the current selection. It can be a\n directional pad (D-pad), trackball, or other device.\n\n\n If an application requires a directional control, but not a control of a\n particular type, it can set this attribute to `\"true\"` and ignore\n the [reqNavigation](#nav) attribute. However,\n if it requires a particular type of directional control, it can ignore\n this attribute and set `reqNavigation` instead.\n\n `android:reqHardKeyboard`\n : Whether the application requires a hardware keyboard. It's\n `\"true\"` if it does, and `\"false\"` if not.\n\n `android:reqKeyboardType`\n : The type of keyboard the application requires, if any.\n This attribute doesn't distinguish between hardware and software\n keyboards. If a hardware keyboard of a certain type is required,\n specify the type here and also set the `reqHardKeyboard` attribute\n to `\"true\"`.\n\n\n The value must be one of the following strings:\n\n\n | Value | Description |\n |---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | \"`undefined`\" | The application doesn't require a keyboard. A keyboard requirement isn't defined. This is the default value. |\n | \"`nokeys`\" | The application doesn't require a keyboard. |\n | \"`qwerty`\" | The application requires a standard QWERTY keyboard. |\n | \"`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. |\n\n `android:reqNavigation`\n : The navigation device required by the application, if any. The value\n must be one of the following strings:\n\n | Value | Description |\n |---------------|--------------------------------------------------------------------------------------------------------------------------------------|\n | \"`undefined`\" | The application doesn't require any type of navigation control. The navigation requirement isn't defined. This is the default value. |\n | \"`nonav`\" | The application doesn't require a navigation control. |\n | \"`dpad`\" | The application requires a D-pad for navigation. |\n | \"`trackball`\" | The application requires a trackball for navigation. |\n | \"`wheel`\" | The application requires a navigation wheel. |\n\n\n If an application requires a navigational control, but the exact type of\n control doesn't matter, it can set the\n [reqFiveWayNav](#five) attribute to `\"true\"`\n rather than setting this one.\n\n `android:reqTouchScreen`\n : The type of touch screen the application requires, if any.\n The value must be one of the following strings:\n\n | Value | Description |\n |---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | \"`undefined`\" | The application doesn't require a touch screen. The touch screen requirement is undefined. This is the default value. |\n | \"`notouch`\" | The application doesn't require a touch screen. |\n | \"`stylus`\" | The application requires a touch screen that is operated with a stylus. |\n | \"`finger`\" | The application requires a touch screen that is operated with a finger. **Note:** If some type of touch input is required for your app, instead use the [`\u003cuses-feature\u003e`](/guide/topics/manifest/uses-feature-element) tag to declare the required touchscreen type, beginning with `\"android.hardware.faketouch\"` for basic touch-style events. |\n\nintroduced in:\n: API level 3\n\nsee also:\n:\n - [configChanges](/guide/topics/manifest/activity-element#config) attribute of the [\u003cactivity\u003e](/guide/topics/manifest/activity-element) element\n - [ConfigurationInfo](/reference/android/content/pm/ConfigurationInfo)"]]