is Vibration Available - Android Hardware

Android examples for Hardware:Vibrator

Description

is Vibration Available

Demo Code


//package com.java2s;

import android.content.Context;

public class Main {
    public static boolean isVibrationAvailable(Context ctx) {
        Object service = ctx.getSystemService(Context.VIBRATOR_SERVICE);
        return (service != null);
    }/*from  ww  w. j a  va 2s .  c om*/
}

Related Tutorials