O'Reilly logo

Hello App Inventor!: Android programming for kids and the rest of us by Paula Beer and Carl Simmons

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

Chapter 9. Position sensors

In chapter 2, you shook your phone and made a sheep disappear using the phone’s accelerometer sensor. Most phones have sensors that can detect much smaller motions than a strong shake. You can see this when you tilt the phone to one side and the display rotates, or if you’ve played a driving game where you steer left and right by gently tilting the phone. Phones can tell which way up they’re facing—for instance, some people set their phone’s ringer to be silent automatically if the phone is face down on a desk. Your phone can also tell which direction is north by using its own built-in compass.

All the apps in this ...

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