UVM
UVM

Reputation: 9914

Shaking Android device

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

Upvotes: 0

Views: 248

Answers (1)

Chris Stratton
Chris Stratton

Reputation: 40407

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

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

Upvotes: 2

Related Questions