Android examples for Hardware:Sensor
get Sensor Chart Max X
//package com.java2s; import android.hardware.Sensor; public class Main { @SuppressWarnings("deprecation") static public double getSensorChartMaxX(Sensor sensor) { double xMax; switch (sensor.getType()) { case Sensor.TYPE_LIGHT: case Sensor.TYPE_PRESSURE: case Sensor.TYPE_PROXIMITY: case Sensor.TYPE_TEMPERATURE: xMax = 50;/*from w w w . j a v a2 s . c o m*/ break; default: xMax = 2000; break; } return xMax; } }