I am having a problem when trying to use rotation vector sensor with new Location and Activity recognition Google APIs. I am using the rotation vector to determine orientation of the device.
Before using APIs: The rotation vector works fine before using the new Google APIs.
After using APIs: The readings for the rotation vector sensor seem fine for the first few readings (about 5) then the readings remain constant (i.e. do not change) and only reports the same value. Based on my observations it appears the APIs (most likely Activity recognition) are affecting the Rotation vector reading.
Does anyone know of this problem? or how to solve it?
if(rotateValues[0].values[0] == rotateValues[1].values[0])
{
sRotation = sensorManager.getDefaultSensor(Sensor.TYPE_ROTATION_VECTOR);
sensorManager.unregisterListener(this,sRotation);
sensorManager.registerListener(this,sRotation,SensorManager.SENSOR_DELAY_NORMAL);
}
This is my solution to the problem it worked!