Chapter 5. Launching tasks and choosers

 

This chapter covers

  • Using the phone APIs
  • Displaying apps with launchers
  • Retrieving data with choosers
  • Reading calendar appointments

A modern mobile phone does more than make phone calls. It allows you to send SMS text messages and emails. Phone numbers and email addresses are stored in the phone’s contact list. Appointments and meetings are viewed using the Calendar application. Music and videos are played from the phone’s media library. And don’t forget about the ever-present camera. Windows Phone developers access these mobile phone features via the Tasks API.

The Windows Phone security model doesn’t allow third-party applications to directly access the native applications and data stores provided by the operating system. Access to native applications is exposed through a variety of classes available in the Tasks API.

In this chapter we explore the Tasks API. You’ll learn how to ask for contact and appointment data stored in the phone’s People Hub and Calendar application. You’ll also use tasks to access the native phone applications. To demonstrate how to use the Tasks API, you’ll build an application that uses several different tasks to initiate phone calls, emails, and text messages.

5.1. The Tasks API

5.2. Launchers

5.3. Choosers

5.4. Summary