There is a method in the android.hardware.SensorEventListener
interface called
void onSensorChanged(android.hardware.SensorEvent sensorEvent)
This method gets called on a registered listener by one of the operating system's threads, whenever it detects that a sensor reading has updated values. The underlying data structure, SensorEvent
has an field called SensorEvent#accuracy
which is used to declare the accuracy of the aforementioned event and is one of Sensor.SENSOR_STATUS_ACCURACY_HIGH
, Sensor.SENSOR_STATUS_ACCURACY_LOW
, Sensor.SENSOR_STATUS_ACCURACY_MEDIUM
or SENSOR_STATUS_UNRELIABLE
.
Now, what I really want to know is how the operating system can tell to what degree a sensor event is accurate.
Does it rely on the physical sensor chip to provide it with accuracy information and if so, how can the chip discern a reading's accuracy ?