First Look at Launchers for Windows Phone
In this article we will look at the various Launchers
available for Windows Phone. Launchers are nothing but enablers to perform
common task enabling to provide a common user experience across the windows
phone platform. This does not return any data.
- Bing Maps Direction Task
- Bing Maps Task
- Connection Settings Task
- Email Compose Task
- Marketplace Detail Task
- Marketplace Hub Task
- Marketplace Review Task
- Marketplace Search Task
- Media Player Launcher
- Phone Call Task
- Search Task
- Share Link Task
- Share Status Task
- SMS Compose Task
- Web Browser Task
In order to use these launchers, we have to reference the
library
using
Microsot.Phone.Tasks;
- Phone Call Task
- SMS Compose Task
- Bing Map Task
In the earlier blog post, we had created a simple
“ContactApp” application. We will add these launchers to them.
Phone Call Task
This task enables the users to make a phone call. From the
“ContactApp”, we will see how a user can place a call when the user double taps
the contact.
From the above code, we see that the “Display Name” which is
used to display name of the calling person and “Phone Number” which is the
number to call properties of the “PhoneCallTask” class has to be set. After
which the “Show” method is invoked to launch the task.
Now when we click on the call button, the call is placed as
shown below
SMS Compose Task
The SMS Compose Task helps enables the users to send SMS for
the application. From the “ContactApp”, we will see how a user can Send SMS
when clicking on the contacts
The
UI for the context menu click is as shown below
Now
in the new page “SendSMS.xaml”, we will add a “Send” button. For click event we
will write the below code as shown
From the above code we see that we will set the “To” which
holds the number of the receiver and “Body” which has the text message
properties of the “SMSComposeTask” class. Then call the “Show” method to invoke
the task.
On
click of the “Send” Button, the below is seen
When we click on the above highlighted button,the sms will
be send.
Bing Map Task
The Bing Map Task enables to launch the bing maps. For the
“ContactApp”, we will see how to locate the contacts location.
We will write the below code
for the context menu item’s “Search Location in Maps” click event
From the above code, we see
that the “Search Term” which accepts the searchable text on the map and the
“ZoomLevel” which can be used to for setting zoom level properties of the
“BingMapsTask” class has to be set. Then call the “Show” method to
invoke the task.
To read about other Launchers in Windows Phone, check out http://msdn.microsoft.com/en-us/library/ff769550(v=vs.92).aspx
Comments