Chapter 14. Take a Picture; It'll Last Longer!

WHAT'S IN THIS CHAPTER?

  • Understanding the concept of Launchers and Choosers

  • Using your device's camera and photo features

  • Creating and sending an SMS text message with SMSComposeTask

  • Creating and sending an e-mail with EmailComposeTask

  • Capturing and using photos with CameraCaptureTask and PhotoChooserTask

  • Using MediaPlayerLauncher to play music from the user's collection

Windows Phone 7 offers a variety of Launchers and Choosers to expose basic phone functionality, such as the Camera Capture and Photo Chooser tasks, as well as the SMS Compose and Email Compose tasks and the Email Address Chooser.

In this chapter, you will learn about the various Launchers and Choosers, how they work, and how to implement them in your apps and games.

LAUNCHERS AND CHOOSERS

Launchers and Choosers are used by Windows Phone games and applications to enable common tasks such as taking a picture, sending a text or e-mail message, and even making a phone call. The Microsoft.Phone.Tasks namespace contains all the Launchers and Choosers for Windows Phone 7. Choosers return some form of data to the calling program, and Launchers do not. Table 14-1 shows some common Launchers and Choosers.

Table 14.1. Common Launchers and Choosers

TASK CATEGORY

CLASS

DESCRIPTION

Camera

CameraCaptureTask

This allows you to take a picture with the phone camera.

 

PhotoChooserTask

This allows you to select a picture already taken.

Contacts

PhoneNumberChooserTask

This allows you to select a phone number ...

Get Professional Windows® Phone 7 Game Development: Creating Games using XNA Game Studio 4 now with O’Reilly online learning.

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