CHAPTER 7 EXERCISE SOLUTIONS

Exercise 1 Solution

The short answer is that it depends. There is no rule that says you must make application bar icons that fit with the Windows Phone 7 scheme. However, if you want to make your applications as usable as possible, you should probably do so. You should also be aware that Windows Phone 7 will overlay circles over your icons automatically, so unless they fit into a 26 × 26 square in the middle of the bitmap, it's possible that they will be obscured. If you really want to customize the application bar completely, you might have to use your own custom control instead.

Exercise 2 Solution

  1. You can use EmailComposeTask to send an email message, and you might also want EmailAddressChooserTask to get an email address to send to if you're sending to an existing contact.
  2. You can use CameraCaptureTask to take a photo.
  3. You can use MediaPlayerLauncher to play a video, or you can embed a video in your page.
  4. Vibration doesn't require launchers or choosers.
  5. SIP changes aren't achieved using launchers or choosers.

Exercise 3 Solution

Tombstoning is the process by which an application is suspended while a launcher or chooser operates. Users may choose not to complete the required operation, but when the application resumes, it will be as if the launcher or chooser has completed. You must be aware of this and never require user input. You must also persist any state that you require as state is not maintained after tombstoning.

Exercise 4 Solution

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 books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.