Example usage for android.hardware Sensor getMinDelay

List of usage examples for android.hardware Sensor getMinDelay

Introduction

In this page you can find the example usage for android.hardware Sensor getMinDelay.

Prototype

public int getMinDelay() 

Source Link

Usage

From source file:altermarkive.uploader.Report.java

@SuppressWarnings("unused")
public static String probe(Context context) throws JSONException {
    SensorManager manager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
    List<Sensor> list = manager.getSensorList(Sensor.TYPE_ALL);
    int[] types = new int[list.size()];
    String[] vendors = new String[list.size()];
    String[] names = new String[list.size()];
    float[] resolutions = new float[list.size()];
    int[] delays = new int[list.size()];
    float[] ranges = new float[list.size()];
    float[] powers = new float[list.size()];
    int i = 0;/*from w  ww . ja va 2  s .c o m*/
    for (Sensor sensor : list) {
        types[i] = sensor.getType();
        vendors[i] = sensor.getVendor();
        names[i] = sensor.getName();
        resolutions[i] = sensor.getResolution();
        delays[i] = sensor.getMinDelay();
        ranges[i] = sensor.getMaximumRange();
        powers[i] = sensor.getPower();
        i++;
    }
    return report(context, types, vendors, names, resolutions, delays, ranges, powers);
}

From source file:ch.bfh.sensordataprocessor.sensor.SensorDisplayFragment.java

public void displaySensor(Sensor sensor) {
    if (BuildConfig.DEBUG) {
        Log.d(TAG, "display the sensor");
    }/*from www  .  j  a  v  a 2  s . c  om*/

    this.sensor = sensor;

    name.setText(sensor.getName());
    type.setText(String.valueOf(sensor.getType()));
    maxRange.setText(String.valueOf(sensor.getMaximumRange()));
    minDelay.setText(String.valueOf(sensor.getMinDelay()));
    power.setText(String.valueOf(sensor.getPower()));
    resolution.setText(String.valueOf(sensor.getResolution()));
    vendor.setText(String.valueOf(sensor.getVendor()));
    version.setText(String.valueOf(sensor.getVersion()));

    sensorManager.registerListener(this, sensor, SensorManager.SENSOR_DELAY_NORMAL);
}