Android examples for Hardware:Vibrator
Vibrate for milliseconds
//package com.java2s; import android.app.Service; import android.content.Context; import android.os.Vibrator; public class Main { public static void Vibrate(Context context, long milliseconds) { Vibrator vib = (Vibrator) context .getSystemService(Service.VIBRATOR_SERVICE); vib.vibrate(milliseconds);/*from w w w . jav a 2 s. co m*/ } }