I have a class that implements SensorEventListener
and I would like to get
the tilt Angle
of my device using the Accelerometer
.
I looked for examples on the internet but they use
Sensor.TYPE_MAGNETIC_FIELD
.
I believe my device doesn't have this sensor because when I do the
following check
manager.getSensorList(Sensor.TYPE_ACCELEROMETER).size()
, I get zero.
Is there a way to get the tilt Angle
by just using
Sensor.TYPE_ACCELEROMETER
values?
As people suggested you can use the accelerometer and magnetic sensor to do this.
Here is a blog post with a complete solution.
http://www.ahotbrew.com/how-to-detect-forward-and-backward-tilt/