Android: Haptic feedback: onClick() event vs hapticFeedbackEnabled in the view
<p>If you want a button to provide haptic feedback (ie, the phone vibrates very briefly so you can feel that you really pushed the button), what's the standard way to do that?
It seems you can either explicitly set an onClick() event and call the vibrate() function, giving a number of milliseconds to vibrate, or you can set hapticFeedbackEnabled in the view.</p>

<p>The documentation seems to indicate that the latter only works for long-presses or virtual on-screen keys:  <a href="http://developer.android.com/reference/android/view/View.html#performHapticFeedback(int)">http://developer.android.com/reference/android/view/View.html#performHapticFeedback(int)</a></p>

<p>If that's right, then I need to either make my button a virtual on-screen key or manually set the onClick() event.</p>

<p>What do you recommend?</p>

<p>Also, if I want the vibrating to happen immediately when the user's finger touches the button, as opposed to when their finger "releases" the button, what's the best way to accomplish that?</p>

<p>Related question:  <a href="http://stackoverflow.com/questions/2228151/how-to-enable-haptic-feedback-on-button-view">http://stackoverflow.com/questions/2228151/how-to-enable-haptic-feedback-on-button-view</a></p>
