- ไวยากรณ์:
<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"] />
- ที่อยู่ใน:
<manifest>
- description:
ระบุฟีเจอร์ของฮาร์ดแวร์และซอฟต์แวร์ที่แอปพลิเคชันต้องการ ตัวอย่างเช่น แอปพลิเคชันอาจระบุว่าต้องใช้แป้นพิมพ์จริง หรืออุปกรณ์นำทางที่เฉพาะเจาะจง เช่น แทร็กบอล ข้อกำหนดเฉพาะคือ เพื่อหลีกเลี่ยงการติดตั้งแอปพลิเคชันบนอุปกรณ์ที่ใช้งานไม่ได้
หมายเหตุ: แอปส่วนใหญ่ไม่ได้ใช้แท็กไฟล์ Manifest นี้ รองรับการป้อนข้อมูลด้วยปุ่มบังคับทิศทาง (D-pad) เพื่อช่วยผู้ที่มีความบกพร่องทางสายตาทุกครั้ง ผู้ใช้และอุปกรณ์ที่รองรับซึ่งมีอินพุต D-pad นอกเหนือจากหรือแทนการสัมผัส
สำหรับ ข้อมูลเกี่ยวกับวิธีรองรับการป้อนข้อมูล D-pad ในแอปที่หัวข้อจัดการการทำงานของตัวควบคุม ถ้า แอปจะทำงานไม่ได้หากไม่มีหน้าจอสัมผัส ให้ใช้แท็ก
<uses-feature>
แทนเพื่อ ประกาศประเภทหน้าจอสัมผัสที่จำเป็น โดยมีตั้งแต่"android.hardware.faketouch"
สำหรับแบบพื้นฐาน เหตุการณ์รูปแบบการแตะไปจนถึงประเภทการแตะขั้นสูงขึ้น เช่น"android.hardware.touchscreen.multitouch.jazzhand"
สำหรับการป้อนข้อมูลที่แตกต่างกันจากหลากหลายนิ้ว- ดังนี้
android:reqFiveWayNav
- แอปพลิเคชันต้องใช้การควบคุมการนำทางแบบ 5 ทิศทางหรือไม่ ตอนนี้
"true"
หากมี และ"false"
หากไม่เป็นเช่นนั้น 5 ทิศทาง มีตัวควบคุมที่สามารถย้ายการเลือกขึ้น ลง ขวา หรือซ้าย และ จะระบุวิธีเรียกใช้รายการที่เลือกปัจจุบันด้วย อาจเป็น แป้นบังคับทิศทาง (D-pad) แทร็กบอล หรืออุปกรณ์อื่นๆหากแอปพลิเคชันต้องการการควบคุมทิศทาง แต่ไม่ใช่การควบคุม ประเภทที่เจาะจง ก็จะตั้งค่าแอตทริบิวต์นี้เป็น
"true"
และละเว้นได้reqNavigation
อย่างไรก็ตาม ถ้าต้องใช้การควบคุมทิศทาง ประเภทใดประเภทหนึ่ง เครื่องอาจเพิกเฉย แอตทริบิวต์นี้และตั้งค่าreqNavigation
แทน android:reqHardKeyboard
- แอปพลิเคชันต้องใช้แป้นพิมพ์ที่เป็นฮาร์ดแวร์หรือไม่ ตอนนี้
"true"
หากมี และ"false"
หากไม่เป็นเช่นนั้น android:reqKeyboardType
- ประเภทแป้นพิมพ์ที่แอปพลิเคชันต้องการ (หากมี)
แอตทริบิวต์นี้ไม่แยกแยะระหว่างฮาร์ดแวร์กับซอฟต์แวร์
แป้นพิมพ์ หากจำเป็นต้องใช้แป้นพิมพ์ที่เป็นฮาร์ดแวร์บางประเภท
ระบุประเภทที่นี่และตั้งค่าแอตทริบิวต์
reqHardKeyboard
ไปยัง"true"
ค่าต้องเป็นสตริงใดสตริงหนึ่งต่อไปนี้
ค่า คำอธิบาย " undefined
"แอปพลิเคชันไม่ต้องใช้แป้นพิมพ์ ไม่ได้ระบุข้อกำหนดสำหรับแป้นพิมพ์ นี่คือค่าเริ่มต้น " nokeys
"แอปพลิเคชันไม่ต้องใช้แป้นพิมพ์ " qwerty
"แอปพลิเคชันต้องใช้แป้นพิมพ์ QWERTY มาตรฐาน " twelvekey
"แอปพลิเคชันนี้ต้องการแป้นกดร่วม 12 ปุ่ม เช่นเดียวกับแป้นต่างๆ โทรศัพท์ที่มีคีย์สำหรับตัวเลขตั้งแต่ 0
ถึง9
บวกแป้นดาว (*
) และสี่เหลี่ยม (#
) android:reqNavigation
- อุปกรณ์นำทางที่แอปพลิเคชันต้องใช้ (หากมี) ค่า
ต้องเป็นสตริงใดสตริงหนึ่งต่อไปนี้
ค่า คำอธิบาย " undefined
"แอปพลิเคชันนี้ไม่ต้องใช้การควบคุมการนำทางประเภทใดเลย ไม่ได้กำหนดข้อกำหนดการนำทาง นี่คือค่าเริ่มต้น " nonav
"แอปพลิเคชันไม่ต้องใช้ตัวควบคุมการนำทาง " dpad
"แอปพลิเคชันต้องใช้ D-pad สำหรับการนำทาง " trackball
"แอปพลิเคชันต้องใช้แทร็กบอลสำหรับการนำทาง " wheel
"แอปพลิเคชันต้องใช้วงล้อการนำทาง หากแอปพลิเคชันต้องใช้การควบคุมการนำทาง แต่ประเภท ควบคุมได้ทุกอย่าง จึงสามารถตั้งค่า แอตทริบิวต์
reqFiveWayNav
เป็น"true"
แทนการตั้งค่าการตั้งค่านี้ android:reqTouchScreen
- ประเภทหน้าจอสัมผัสที่แอปพลิเคชันต้องการ (หากมี)
ค่าต้องเป็นสตริงใดสตริงหนึ่งต่อไปนี้
ค่า คำอธิบาย " undefined
"แอปพลิเคชันไม่ต้องใช้หน้าจอสัมผัส ไม่ได้ระบุข้อกำหนดหน้าจอสัมผัส นี่คือค่าเริ่มต้น " notouch
"แอปพลิเคชันไม่ต้องใช้หน้าจอสัมผัส " stylus
"แอปพลิเคชันต้องใช้หน้าจอสัมผัสที่ทำงานด้วยสไตลัส " finger
"แอปพลิเคชันต้องใช้หน้าจอสัมผัสที่ทำงานด้วยนิ้ว หมายเหตุ: หากแอปของคุณต้องใช้การป้อนข้อมูลด้วยการสัมผัสบางประเภท ให้ใช้ แท็ก
<uses-feature>
เพื่อประกาศว่าต้องใช้หน้าจอสัมผัส ประเภท ขึ้นต้นด้วย"android.hardware.faketouch"
สำหรับกิจกรรมแบบสัมผัสพื้นฐาน
- เปิดตัวใน
- API ระดับ 3
- ดูเพิ่มเติม
-
configChanges
ของแอตทริบิวต์ วันที่<activity>
องค์ประกอบConfigurationInfo
<uses-configuration>
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 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)"]]