ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
การประเมินฮาร์ดแวร์
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
การประเมินฮาร์ดแวร์จะแสดงลักษณะเชิงปริมาณของเอฟเฟกต์การสัมผัสเป้าหมาย 3 รายการที่สุ่มตัวอย่างโดยวิธีการทั่วไปที่ใช้เรียกใช้การสัมผัส เมื่อสิ้นสุดการประเมิน คุณสามารถนําประสิทธิภาพจากอุปกรณ์แต่ละเครื่องสําหรับเอฟเฟกต์การสัมผัสเป้าหมายแต่ละรายการไปใช้กับแผนที่ประสิทธิภาพเพื่อสรุปผล
แผนที่ประสิทธิภาพจะแสดงผลการประเมินฮาร์ดแวร์จากอุปกรณ์ Android รุ่นต่างๆ ปัจจุบัน เป้าหมายคือการประเมินอุปกรณ์เป้าหมายโดยใช้การเปรียบเทียบแบบสัมพัทธ์ตามบริบท (แทนการตัดสินว่าผ่านหรือไม่ผ่าน) คำถามที่เจาะจงซึ่งสร้างขึ้นจากแนวคิดนี้ ได้แก่ ประสิทธิภาพของโทรศัพท์เมื่อเทียบกับคู่แข่งเป็นอย่างไรเมื่อพิจารณาจากระดับราคาและประเภทตัวกระตุ้น ผลลัพธ์เป็นไปตามความคาดหวังหรือไม่ หากไม่ มีอะไรที่ต้องปรับปรุงบ้าง
รูปที่ 1 ภาพรวมกระบวนการประเมินฮาร์ดแวร์ของฟีเจอร์การสัมผัส
การประเมินจะสังเกตผลลัพธ์ของ 3 วิธีในเฟรมเวิร์กการสัมผัสของ Android
ผลลัพธ์ที่ 1: ผลลัพธ์ของการสัมผัสแบบสั้นที่กำหนดไว้ล่วงหน้า
VibrationEffect.EFFECT_CLICK
ค่าคงที่นี้เป็นผลฐานหรือตัวหารร่วมในการแมป HAL-API ที่ระบุไว้ในแมปค่าคงที่ระหว่าง HAL กับ API
ซึ่งจะเชื่อมโยงกับเอฟเฟกต์ที่ใช้กันมากที่สุด
HapticFeedbackConstants.KEYBOARD_PRESS
การประเมินผลนี้จะช่วยให้คุณทราบความพร้อมของอุปกรณ์เป้าหมายสำหรับการสัมผัสที่ชัดเจน
ผลลัพธ์ที่ 2: ผลลัพธ์การสัมผัสที่กำหนดเองสั้นๆ
VibrationEffect.createOneShot(20,255)
สําหรับพัลส์ที่กำหนดเองสั้นๆ รายการเดียว เราขอแนะนําให้ใช้เกณฑ์สูงสุด 20 ms เพื่อกําหนดระยะเวลา ไม่แนะนำให้ใช้แรงกระตุ้นเดียวที่นานกว่า 20 ms เนื่องจากผู้ใช้จะรับรู้ว่าเป็นการสั่นที่ดังกึกก้อง
รูปที่ 2 ผลลัพธ์การสัมผัสที่กำหนดเองสั้นๆ
เอฟเฟกต์ที่ 3: เอฟเฟกต์การสัมผัสที่ผู้ใช้กำหนดเองแบบยาวที่มีการเปลี่ยนแปลงความกว้างของคลื่น
VibrationEffect.createWaveform(timings[], amplitudes[], int repeat)
ความสามารถในการสร้างแอมพลิจูดที่หลากหลายสำหรับเอฟเฟกต์การสัมผัสที่กําหนดเองเป็นหนึ่งในตัวบ่งชี้ในการประเมินความสามารถของอุปกรณ์สําหรับการสัมผัสที่สมจริง
timings [ ]
และ amplitudes [ ]
ที่แนะนําคือ {500, 500}
และ
{128, 255}
ตามลำดับ กราฟนี้แสดงแนวโน้มความกว้างของพัลส์ที่เพิ่มขึ้นจาก 50% เป็น 100% โดยมีอัตราการสุ่มตัวอย่าง 500 มิลลิวินาที
รูปที่ 3 สัมผัสที่กำหนดเองแบบยาวที่มีการเปลี่ยนแปลงความกว้าง
หากต้องการตรวจสอบความสามารถของฮาร์ดแวร์ในการควบคุมระดับความดังสำหรับเอฟเฟกต์ 3 ให้ลองใช้ Vibrator.hasAmplitudeControl()
ผลลัพธ์ต้องเป็น true
เพื่อดำเนินการ
VibrationEffect.createWaveform
โดยมีแอมพลิจูดที่เปลี่ยนแปลงตามที่ตั้งใจไว้
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา 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,["# Hardware assessment\n\nThe hardware assessment delivers quantitative characteristics of three target\nhaptic effects sampled by common methods used to call haptics. At the end of the\nassessment, performance from each device for each target haptic effect can be\napplied to the [performance map](/docs/core/interaction/haptics/compare) to\ndraw conclusions.\n\nThe performance map shows the hardware assessment results from several current\nAndroid devices. The goal is to evaluate the target device using a contextually\nrelative comparison (rather than a pass or fail judgement). Specific questions\nstructured around that notion are: *Given the price tier and\nactuator type of my phone, how is the performance compared to my competitors? Do\nthe results meet my expectations? If not, what needs improvement?*\n\n**Figure 1.** Haptics hardware assessment process overview\n\nThe assessment observes the results of three methods in the Android haptic\nframework.\n\n### Effect 1: Predefined short haptic constants\n\n[`VibrationEffect.EFFECT_CLICK`](https://developer.android.com/reference/android/os/VibrationEffect.html#EFFECT_CLICK)\n\nThis constant is the baseline effect or common denominator in the HAL-API\nmapping provided in\n[Map constants between HAL and API](/docs/core/interaction/haptics/haptics-map-constants).\nIt's mapped with the most commonly used effect\n[`HapticFeedbackConstants.KEYBOARD_PRESS`](https://developer.android.com/reference/android/view/HapticFeedbackConstants#KEYBOARD_PRESS).\nAssessing this effect helps you determine the readiness of your\ntarget device for\n[clear haptics](/docs/core/interaction/haptics/haptics-ux-foundation#clear-haptics).\n\n### Effect 2: Short custom haptic effect\n\n[`VibrationEffect.createOneShot(20,255)`](https://developer.android.com/reference/android/os/VibrationEffect#createOneShot(long,%20int))\n\nFor short single custom impulses, 20 ms is the recommended maximum\nthreshold to define duration. A single impulse that's longer than 20 ms\nisn't recommended because it's perceived as a\n[buzzy vibration](/docs/core/interaction/haptics/haptics-ux-foundation#buzzy-vibration).\n\n**Figure 2.** Short custom haptic effect\n\n### Effect 3: Long custom haptic effect with amplitude variation\n\n[`VibrationEffect.createWaveform(timings[], amplitudes[], int repeat)`](https://developer.android.com/reference/android/os/VibrationEffect#createWaveform(long%5B%5D,%20int%5B%5D,%20int))\n\nThe ability to produce varying amplitudes for custom haptic effects is one of\nthe indicators to evaluate the device's capabilities for\n[rich haptics](/docs/core/interaction/haptics/haptics-ux-foundation#rich-haptics).\nThe recommended `timings [ ]` and `amplitudes [ ]` are `{500, 500}` and\n`{128, 255}`, respectively. This presents an increasing trend of amplitude from\n50% to 100% with a 500 ms sampling rate.\n\n**Figure 3.** Long custom haptic effect with amplitude variation\n\nTo quickly check the hardware capabilities of amplitude control for Effect 3,\ntry\n[`Vibrator.hasAmplitudeControl()`](https://developer.android.com/reference/android/os/Vibrator#hasAmplitudeControl()).\nThe result has to be `true` to execute\n[`VibrationEffect.createWaveform`](https://developer.android.com/reference/android/os/VibrationEffect#createWaveform(long%5B%5D,%20int%5B%5D,%20int))\nwith varying amplitude as intended."]]