What are Launchers and Choosers in Windows Phone 7

Launcher and Choosers API allows application to interact with Native Applications of Windows Phone 7

clip_image002

Launchers

clip_image003

  • Launchers are collection of classes in Windows Phone 7.
  • They help to interact with inbuilt applications on native application of Windows Phone 7.
  • Launchers used to launch one of the inbuilt or native applications from your application.
  • Launchers do not return any data from the inbuilt or native application.

Different Launchers are as below,

  • EmailComposerTask
  • PhoneCallTask
  • SmsComposeTask
  • MarketPlaceHubTask
  • MarketPlaceSearchTask
  • MarketPlaceDetailsTask
  • MarketPlaceReviewTask
  • MediaPlayerLauncher
  • WebBrowserTask
  • SearchTask

Choosers

clip_image004

  • Choosers are collection of classes in Windows Phone 7.
  • They help to interact with inbuilt or native applications of Windows Phone 7.
  • Choosers launch and native application and returns data from the launched application for further manipulation also.
  • Choosers return data to the application using choosers.
  • It’s not necessary that all the Choosers return data. For example SaveEmailAddressTask chooser task does not return any data to the calling application.

Data return by the Choosers should be handled in the completed event of the Choosers.

Different choosers are as below,

  • CameraCaptureTask
  • PhotoChoosersTask
  • SaveEmailAddressTask
  • EmailAddressChoosersTask
  • SavePhoneNumberTask
  • PhoneNumberChooserTask

Using Choosers and Launchers in Code

You need to make instance of choosers or launcher to use them. You need to add below namespace to use various launchers or choosers.

clip_image005

After creating instance you need to call Show method () as below. There are many options also you can set with different launchers.

clip_image006

In case of Chooser you need to handle completed event to work with returned data.

Good Practice to use Choosers in the code

There are three points you need to keep in mind while working with choosers in Windows Phone 7. To explain you more I am using PhotoChooserTask

Three points are as below,

Point 1

You need to instantiate Choosers as the global variable on the page of the application

clip_image007

Point 2

You need to make sure that you are registering completed event in constructor of the page.

clip_image009

Point 3

In the completed event of Chooser, first you need to check for the TaskResult value. If it is ok then perform the task.

clip_image010

This is all about Launchers and Choosers. I hope this post is useful. Thanks for reading.

2 responses to “What are Launchers and Choosers in Windows Phone 7”

  1. […] What are Launchers and Choosers in Windows Phone 7 […]

  2. what if i want to call any native application??

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a website or blog at WordPress.com