Vibration and haptic feedback

For haptic feedback on button touches:

view.setHapticFeedbackEnabled(true);

or in the layout:

android:hapticFeedbackEnabled="true"

Triggering haptic feedback manually:

view.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);

Vibrate:

Vibrator vibo = (Vibrator) this.getSystemService(VIBRATOR_SERVICE);
vibo.vibrate(millis);

Note: only this last one requires the permission:

<uses-permission android:name="android.permission.VIBRATE" />