Learning MIT App Inventor: A Hands-On Guide to Building Your Own Android Apps
by Derek Walter, Mark Sherman
The Orientation Sensor
Nearly every Android device supports the useful Acceleration Sensor, but another sensor also gives you physical information. The Orientation Sensor tells how the phone is oriented relative to the Earth. This sensor provides roll, pitch, and azimuth data.
Imagine for a moment that the phone is an airplane (Figure 10.13). Looking at the phone as you normally would, the top (earpiece) would be the nose of the plane and the bottom (the home button and so on) would be the tail end. The roll is how much the plane rotates without the tail or nose moving, or how much the wings move up and down. The pitch is how much higher or lower the nose is than the tail.
Figure 10.13 Imagine that the phone is an airplane—the pitch and roll ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access