Chapter 8. Using sensors
This chapter covers
Some really cool applications can be built combining sensors with other features of the phone. Applications might respond to a user shaking the device by randomly selecting an object or clearing the screen. Games can use the device’s movement as an input mechanism, basically turning the whole phone into a game controller. Another class of applications augments the real world with computer-generated information. Augmented reality apps can show you the location of friends nearby relative to your current location. Astronomy applications determine the position of your device and identify the stars in the night sky. A tourist application might be able to identify nearby landmarks.
All of these applications require sensor input from the physical world. The phone’s accelerometer, compass, and gyroscope sensors capture input from the real world and serve the data to applications through the Windows Phone SDK’s Sensor API. When combined with location data from the phone’s Location Service, stunning augmented reality applications are possible. We discuss the location service in chapter 13.