2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
ハードウェア評価
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
ハードウェア評価では、ハプティクスの呼び出しに使用される一般的なメソッドでサンプリングされる 3 つの対象の触覚効果の量的特性を判断します。評価の最後に、対象の各触覚効果のデバイスごとのパフォーマンスをパフォーマンス マップに当てはめて結論を出すことができます。
パフォーマンス マップには、いくつかの現在の Android デバイスからのハードウェア評価の結果が示されています。このマップの目的は、(合格または不合格の判断ではなく)コンテキストに基づく相対的な比較を使用して対象デバイスを評価することです。この考えに基づく具体的な質問は「このスマートフォンの価格帯とアクチュエータの種類から考えると、パフォーマンスは競合他社と比べてどうか?結果は期待どおりか?期待どおりではなかった場合は、どの点を改善する必要があるか?」のようになります。
図 1. ハプティクスのハードウェア評価プロセスの概要
この評価では、Android ハプティクス フレームワークの 3 つのメソッドの結果を測定します。
効果 1: 事前定義の短い触覚定数
VibrationEffect.EFFECT_CLICK
この定数は、HAL と API の間で定数をマッピングするで提供された HAL - API マッピングのベースライン効果または共通点です。これは、よく使用される効果である HapticFeedbackConstants.KEYBOARD_PRESS
にマッピングされています。この効果を評価することで、対象デバイスがクリア ハプティクスに対応しているかどうかを判断できます。
効果 2: 短いカスタム触覚効果
VibrationEffect.createOneShot(20,255)
短い単一のカスタム インパルスの場合、期間を定義する推奨最大しきい値は 20 ミリ秒です。20 ミリ秒を超える単一インパルスは、耳障りなバイブレーションとして認識されるため、おすすめしません。
図 2. 短いカスタム触覚効果
効果 3: 振幅変動を伴う長いカスタム触覚効果
VibrationEffect.createWaveform(timings[], amplitudes[], int repeat)
カスタム触覚効果のさまざまな振幅を生成する機能は、リッチ ハプティクスに関するデバイスの機能を評価する指標の 1 つです。推奨される timings [ ]
と amplitudes [ ]
はそれぞれ {500, 500}
と {128, 255}
です。これは、500 ミリ秒のサンプリング レートで 50% から 100% まで振幅の増加傾向を示します。
図 3. 振幅変動を伴う長いカスタム触覚効果
効果 3 の振幅制御のハードウェア機能をすぐに確認するには、Vibrator.hasAmplitudeControl()
メソッドをお試しください。振幅が想定どおり変化するように VibrationEffect.createWaveform
を実行するには、結果が true
になる必要があります。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-03-10 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-03-10 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."]]