To vibrate your Android device programatically use the code below. The 1000 stands for a duration of 1000 milliseconds.
((Vibrator)getSystemService(VIBRATOR_SERVICE)).vibrate(1000);
Don't forget to add the required permission to your AndroidManifest.xml file:
<uses-permission android:name="android.permission.VIBRATE" />