Launcher and Choosers API allows application to interact with Native Applications of Windows Phone 7
- 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,
- 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,
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.
After creating instance you need to call Show method () as below. There are many options also you can set with different launchers.
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,
You need to instantiate Choosers as the global variable on the page of the application
You need to make sure that you are registering completed event in constructor of the page.
In the completed event of Chooser, first you need to check for the TaskResult value. If it is ok then perform the task.
This is all about Launchers and Choosers. I hope this post is useful. Thanks for reading.