Code example for Vibrator

Methods: vibrate

0
      * Vibrate for s seconds. 
      */ 
     public static void vibrate(double s) {
         Vibrator v = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
         if (v != null) {
             v.vibrate((int) (1000 * s));
         } 
     } 
 
     /** 
      * Get an Overview of all Hardware Sensors of an Android Device 
      */ 
     public static String getHardwareSensors() {
        SensorManager sm = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
        List<Sensor> allSensors = sm.getSensorList(Sensor.TYPE_ALL);
 
        if (allSensors != null) {
            String resultString = "";
            for (Sensor s : allSensors) {
                resultString += String.format("Name=" + s.getName());
                resultString += String.format(",Vendor=" + s.getVendor());