List of the sensors in a device

In December 2012 I wrote a post about an app that displays the sensor list in an android device, now after about a year and a half the API 19 have new sensor types and methods and I thought to update the app.

The main changes have been made to the class MySensor:

The layout has been modified to show the values ​​of the fields fifoMaxEventCount and fifoReservedEventCount, you can download the files of the app here.

This is the list of new types of sensors:

  • TYPE_GAME_ROTATION_VECTOR
  • TYPE_GEOMAGNETIC_ROTATION_VECTOR
  • TYPE_GYROSCOPE_UNCALIBRATED
  • TYPE_SIGNIFICANT_MOTION
  • TYPE_STEP_COUNTER
  • TYPE_STEP_DETECTOR

I find very interesting TYPE_GAME_ROTATION_VECTOR that it is like TYPE_ROTATION_VECTOR because it doesn’t use the magnetometer but only the accelerometer to return the rotation vector.
In this way you can’t get the orientation of the device in Earth’s coordinate system but it is more accurate, in other words you know how much the device is rotated but you can’t know the orientation with respect to magnetic north.

There are these new methods in class Sensor with API 19:

  • public int getFifoMaxEventCount()
  • public int getFifoReservedEventCount()

and in the Nexus 5 they are always different from zero except for TYPE_SIGNIFICANT_MOTION, then the batch mode is almost always supported.

sensorlist_nexus5

Leave a Comment

Your email address will not be published.