Skip to content Skip to sidebar Skip to footer

How To Detect Android Device Rotation Parallel To The Ground?

As I know, the most of android devices allows to detect rotation by accelerometer, but I've noticed, that it doesn't detect rotation parallel to the ground. For example, if I put t

Solution 1:

For sensing rotation around z-axis you need to implement a compass function. A good tutorial is this one. To make the resulting values more stable you need to implement some algorithm which smoothes your incoming data (averages over a queue of data, filtering outliers, etc.). Here is a good overview.


Post a Comment for "How To Detect Android Device Rotation Parallel To The Ground?"