Vibration in Android

The code snippet for vibrating android phone is,

Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);

Here 2000 is 2000 milliseconds, the phone will vibrate. And of course you can't test this in emulator, you need a real device to test this.


Popular posts from this blog

AlarmManager and Notification in Android

Open Gallery and get the selected image in appplication

Swipe Action and ViewFlipper in Android