Creating Vibration effect in Android

deepak - Fri Jul 06 2012 14:31:23 GMT-0400 (EDT)

Its very easy to do this !!!!!

Its very easy to do this !!!!!

deepak - Fri Jul 06 2012 14:33:40 GMT-0400 (EDT)

Steps to create the vibration effect - Step 1


Add the below permission to the android manifest


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



Initialize the Vibrator object with 
the vibration service context


Vibrator vibe = 
(Vibrator) context.getSystemService
(Context.VIBRATOR_SERVICE) ;

deepak - Fri Jul 06 2012 14:39:12 GMT-0400 (EDT)

Steps to create the Vibration Effect - Final Step


Use the vibrate method to create the vibration.
The parameter that needs to be passed to this
method is the time in milli secs.

vibe.vibrate(20);