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

Open Gallery and get the selected image in appplication

Dismiss or Cancel dialog by swipe gesture

AlarmManager and Notification in Android