I want to know if a device is flat to the ground or not?
Flat Mode:
My Android device is placed flat on a table with its screen upside. Then it is laying flat to the ground.
Not Flat:
And when I picks up the device from its top corner - keeping its bottom corner still on table. Then it starts standing vertical to the ground. And Now it is not lying flat to the ground anymore.
Problems:
How can I know exactly using sensors and SensorEvents in android about this? TYPE_ORIENTATION
is now deprecated. But still how can specific sensor values be used to determine if the device is flat to the ground or not. Where would I find such calculation?
I have explored some posts about sensors but I am still confused how my problem is going to get solved?
Related Posts:
How should I calculate azimuth, pitch, orientation when my Android device isn't flat?