Java tutorial
//package com.java2s; import android.content.Context; import android.os.Vibrator; public class Main { public static void vibrate(Context context, long milliseconds) { Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE); vibrator.vibrate(milliseconds); } public static void vibrate(Context context, long[] pattern, int repeat) { Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE); vibrator.vibrate(pattern, repeat); } }