0

How to produce shaking(revaberating) effect in android(Similar to PS2 when a car hit an obstacle)?

UVM
  • 9,776
  • 6
  • 41
  • 66
  • possible duplicate of [Android: I want to shake it!](http://stackoverflow.com/questions/2317428/android-i-want-to-shake-it) – T.J. Crowder Dec 28 '10 at 13:16

1 Answers1

2
public Vibrator vibrator;
vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
vibrator.vibrate(1000);

You will also need android.permission.VIBRATE in the manifest

Chris Stratton
  • 39,853
  • 6
  • 84
  • 117