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

Detecting Tilt (and a Little Background Physics)

The accelerometer can detect very subtle accelerations in three directions. One such acceleration is the constant one from gravity. Think back to your physics class (or think forward if you haven’t gotten there yet): Gravity constantly applies a downward acceleration to every object on Earth, even if that object is sitting completely still. If that object happens to have a three-axis accelerometer, as smartphones do, that device can detect that acceleration.

Take a look at Figure 10.12. On the left is a phone lying flat on a table, not moving. The only acceleration present is gravity, which is pulling straight down (the green arrow). The blue axes in the middle show the direction of the accelerometer’s ...

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