O'Reilly logo

Learning MIT App Inventor: A Hands-On Guide to Building Your Own Android Apps by Mark Sherman, Derek Walter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required