Vibrate the device - Android Phone

Android examples for Phone:Phone Information

Description

Vibrate the device

Demo Code


//package com.java2s;

import android.content.Context;

import android.os.Vibrator;

public class Main {
    /** Vibrate the device  */
    public static void vibrate(Context context, long milisecs) {
        Vibrator v = (Vibrator) context/*from   ww w .j av  a  2  s .  com*/
                .getSystemService(Context.VIBRATOR_SERVICE);
        v.vibrate(milisecs);
    }
}

Related Tutorials