I have software designed for 2.3.3 where I am using the gravity sensor.
Code below -
private SensorManager sman = (SensorManager) getContext().getSystemService(Context.SENSOR_SERVICE);
private Sensor magnetfield, gravity;
...
magnetfield = sman.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
gravity = sman.getDefaultSensor(Sensor.TYPE_GRAVITY);
I decided to add support for version 2.1. However it seems TYPE_GRAVITY is not supported in 2.1, and I get an error that Sensor.TYPE_GRAVITY
is not recognized anymore.
Questions - A) When I search for "Android gravity sensor 2.1" googles links to videos that demo gravity sensor in 2.1 devices. Does that mean there is a way to get access to it? B) If not, what is the lowest version that can use this? Couldn't find it in the SDK.
Thanks