A simple Android library which provides a legend for the sensor values by providing the sensor type. The legends returned are based on the official Android Developers Reference.
String[] shortDescriptions = SensorValueLegend.getDescriptionsShort(Sensor.TYPE_ACCELEROMETER);
// shortDescriptions contains -> [0] = "accX", [1] = "accY", [2] = "accZ"
String[] fullDescriptions = SensorValueLegend.getDescriptionsFull(Sensor.TYPE_ACCELEROMETER);
// fullDescriptions contains -> [0] = "Acceleration including gravity on x-axis", [1] = "Acceleration including gravity on y-axis", [2] = "Acceleration including gravity on z-axis"
String[] units = SensorValueLegend.getUnits(Sensor.TYPE_ACCELEROMETER);
// units contains -> [0] = "m/s²", [1] = "m/s²", [2] = "m/s²"
In your module's build.gradle reference the library:
dependencies {
// ...
compile 'com.michaeltroger.sensorvaluelegend:sensorvaluelegend:1.0.3'
}
That's all!