Interacting with the Hardware


  • What's different about mobile development
  • Responding to changes in device orientation
  • Using the built-in Back button
  • Communicating with users through vibration
  • Using the FM radio
  • Using the accelerometer sensor

One of the most exciting things about writing applications for mobile devices is that their capabilities can be vastly different from more “traditional” platforms. Mobile devices fit in the palm of your hand, and you can move them around, shake them, and interact with them in other unusual ways. If you tried to do that with a desktop PC, you'd probably only succeed in breaking something or injuring yourself.

In this chapter, you'll learn about the differences in capabilities between mobile devices and desktop PCs and how to write code that takes these differences into account. You also learn about the difficulties inherent in developing with an emulator that doesn't always give you access to these capabilities.

Specifically, after you've learned about the differences in capabilities, you'll look at how to determine the orientation of a device and ensure that your applications respond to orientation changes. This helps you ensure that your applications look good and function well, regardless of how users hold their devices — and it even allows you to introduce additional functionality.

Next, you look at the Back button. This button, along with the Search button, must be present on all devices that run Windows ...

Get Beginning Windows® Phone 7 Application Development: Building Windows® Phone Applications Using Silverlight® and XNA® now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.