Writing Motion Detecting Apps in Flash for Android and iOS

Professional Flash Mobile Development: Creating Android and iPhone ApplicationsAndroid and iOS devices have built-in motion detectors that enable programmers to capture the motion that occurs on a three-dimensional axis. This capability enables you to detect all sorts of user motions — tilting the phone, shaking back and forth, and rotating it in a circular fashion.

This chapter introduces you to the Accelerometer and AccelerometerEvent classes and shows you how to detect motion in your apps. It walks you through the creation of three apps that demonstrate different aspects of motion detection:

  • AccelerateInfo, which lists raw data from the motion sensor
     
  • SphereAcceleration, which uses the Accelerometer to guide a sphere around the viewport
     
  • Shakey, which captures a shake event

Download Detecting Motion with Accelerometer

This article is chapter 5 "Detecting Motion with Accelerometer" of the book Professional Flash Mobile Development: Creating Android and iPhone Applications by Richard Wagner(ISBN: 978-0-470-91622-3, Wrox, 2011, Copyright John Wiley & Sons, Inc.) Also available in DRM-free PDF ebook.

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *