[null,null,["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Haptics design principles\n\nWhen it comes to haptic feedback on mobile devices, less is more. Too much\nvibration can be annoying and even numbing to the hands, as the device is\nusually in-hand with the user's full attention. It can also be distracting from\nthe user's intended task, which may lead the user to quickly turn off all\nhaptics. However, well crafted haptics provide valuable sensory feedback that\nprovide users with a richer engagement with their device.\n\nThis page explains use cases for using haptics, introduces\n[classifications](#haptics_classifications) for haptic effects, and also covers\nbasic [guidelines](#haptics_design_guidelines) for apps.\n\nUse cases for adding haptics to your app\n----------------------------------------\n\nHere are some reasons for incorporating haptics into your app.\n\n- **To notify the user of an event that needs their attention.** Examples\n include an incoming phone call or text message, or an upcoming meeting on\n the calendar.\n\n- **To confirm a state change in the device following a user action.**\n Examples include click feedback for a button press, unlocking a phone,\n fingerprint acceptance or rejection, or activating the camera.\n\n- **To delight the user with effects.** Such effects could enhance an ongoing\n user action or emulate physical interaction. Examples include scroll\n feedback, a slider snapping into place, or haptic effects in sync with\n animations, sounds, videos, and games.\n\nHaptics classifications\n-----------------------\n\nThe haptic principles presented here are designed around *clear haptics* ,\n*rich haptics* , and *buzzy haptics*.\n\n### Clear haptics\n\nClear haptics refers to crisp and clean sensations associated with a discrete\nevent, such as button presses. These effects often aim to imitate a\ncorresponding real-world mechanical action, like those felt when pressing on a\nphysical button.\n\nAndroid has predefined clear haptic effects in [`VibrationEffect`](/reference/android/os/VibrationEffect). However,\nin general apps should use action-oriented constants from\n[`HapticFeedbackConstants`](/reference/android/view/HapticFeedbackConstants) to ensure consistency of effect and action across\nthe device.\n\nThe other advantage of action-oriented constants is that the platform can\nprovide fallback behavior if a more complex effect isn't supported by the\nuser's device.\n\nAs you expand the use cases of haptic feedback, the available clear haptics can\nsometimes feel plain and monotone. In that case, aim for rich haptics\nthat are more expressive.\n\n### Rich haptics\n\nRich haptics generally require haptic actuators that have a wider frequency\nbandwidth, enabling greater expressiveness and range. Rich haptics can also be\nproduced by sequencing clear haptics [primitives](/develop/ui/views/haptics/custom-haptic-effects#primitives) in varied amplitudes and\nintervals.\n\nExamples of rich haptic effects are:\n\n- A \"fluttery\" sensation, similar to a butterfly flapping its wings on your fingertip\n- The texture of a surface felt by a finger dragging or swiping across it\n- The sensations of wobbliness and instability, or heaviness and reverberation\n\n| **Caution:** Rich haptics are supported by fewer devices, so it's important to have a fallback strategy.\n\n### Buzzy haptics\n\nBuzzy haptics can be characterized by noisy, sharp and penetrating vibrations\nthat leave an after effect such as a tingling sensation even after the vibration\nis over. It also tends to have a ringing effect that feels like a reverberation\nbefore the vibration stops completely.\n\nExamples of buzzy haptic sensations are:\n\n- Operating a jackhammer\n- Riding a motorcycle\n- In mobile devices, a long-winded, ringing vibration after a key press\n\nDating back to pagers and feature phones, low-end mobile phones with\nlow-performance haptic actuators or drivers tended to produce buzzy long\nvibrations for notification purposes.\n| **Important:** Given the choice of buzzy haptics or no haptics for touch feedback, choose no haptics. Some situations where an event is always intended to grab the users attention, such as an incoming notification or call, may be appropriate for applying a buzzy fallback.\n\nHaptics design guidelines\n-------------------------\n\nAt a high level, the design guidelines can be summarized as:\n\n- Favor rich and clear haptics over buzzy haptics.\n- Be consistent, both with the system and the app design.\n- Be mindful of frequency of use, and importance.\n\n### Prioritize predefined haptic constants and effects\n\nIf your action is covered by a predefined action present in\n[`HapticFeedbackConstants`](/reference/android/view/HapticFeedbackConstants), use that constant. This ensures a consistent\nuser interaction experience, which is particularly valuable as an accessibility\nconsideration.\n\nIf you're creating your own effect, consider using the [`VibrationEffect`](/reference/android/os/VibrationEffect)\npredefined effects and the [`VibrationEffect.Composition`](/reference/android/os/VibrationEffect.Composition) primitives. They\nare more likely to give a consistent quality experience across devices that\nsupport them.\n\n### Correlate event importance and frequency with strength\n\nHaptic effects shouldn't overwhelm the user or feel gratuitous.\n\n- Haptic effects applied to very frequent events, like scrolling or moving a\n text handle, should be very subtle to provide a pleasant overall experience.\n\n- More important events, like refreshing a page or submitting a form, should\n be stronger than changing a toggle or scrolling on a list, for example.\n\n- Combine both concepts to create effects that become stronger as the\n interaction reaches a target, for example gradually increasing the amplitude\n of a sequence of ticks with dragging, dropping or snapping actions.\n\n### Be consistent\n\nBe consistent within your app with the application of haptics. If a particular\ninteraction, like form submission or in-app navigation, has haptic feedback,\nmake sure the same effect is applied to all similar interactions. This helps\nusers to associate a meaning to a particular haptic feedback.\n\nAlso be consistent with the Android system by using the same\n[`HapticFeedbackConstants`](/reference/android/view/HapticFeedbackConstants) for well defined interactions, like time pickers or\nvirtual keyboards.\n\n### Design visual and audio experience together with haptics\n\nConsider haptics as part of the total user experience.\n\nWe strongly recommend co-design of visual, audio, and haptic effects. Make it\nharmonious or congruent with visual animations and sound patterns. Visual and\nauditory inputs can enhance the haptics perceived, and a well-designed haptic\neffect can provide a sense of *physicality* to visual and audio effects.\n\nConversely, a haptic feedback that is played out of sync or that feels\ninconsistent with visual and audio effects can be a bit unsettling to the user.\nIn some cases, the user may perceive the haptic actuator to be broken.\n\n### Avoid legacy one-shot vibrations for haptic feedback\n\nAvoid using the legacy [one-shot\nvibrations](/develop/ui/views/haptics/haptics-apis#on_off_vibrations), like the\nones defined by [`VibrationEffect.createOneShot`](/reference/android/os/VibrationEffect#createOneShot(long,%20int)) or performed with the APIs\n[`Vibrator.vibrate(long)`](/reference/android/os/Vibrator#vibrate(long)) and [`Vibrator.vibrate(long[], int)`](/reference/android/os/Vibrator#vibrate(long%5B%5D,%20int)).\n\nThese vibrations might feel buzzy when they last for a long period after the\ninput waveform has ended, especially on devices with a low-performance haptic\nactuator or driver.\n\nA good keyclick haptic feedback signal should last between 10 to 20\nmilliseconds. However, the actuator may continue to ring for another 20 to 50\nmilliseconds after a 20-millisecond input to the actuator has ended. Therefore,\nit's best to avoid single-shot vibrations for this type of feedback."]]