programming4us
programming4us
MOBILE

Introducing Windows Phone 7 Launchers and Choosers

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
When a third-party application runs on a Windows Phone, it runs in an execution environment that is highly restricted. The Windows Phone OS must be restrictive in order to protect unsuspecting users of mobile devices from potential malicious application behavior, which may include stealing personal data stored on the phone, dialing phone numbers without users' knowledge, or corrupting other applications' data stores. One of the major restrictions that Windows Phone OS places on mobile applications is limiting them to their own execution environment, or sandbox, and not allowing them access to other applications' space or internals of the operating system.

Yet many applications need to access the system features of the phone, to play a music file in the media library, for example, or to take a photo, or to send a text message or an e-mail. Windows Phone 7 OS enables such application interactions with the device via a set of Application Programming Interface (API) tasks referred to as launchers and choosers. It is relatively easy to use launchers and choosers from within your application, but when one is invoked or when a user presses hardware buttons on the phone, managing application state does get a little tricky.

Introducing Windows Phone 7 Launchers and Choosers

When an application executes, the Windows Phone 7 OS confines it to its own space, or sandbox. Both memory and file storage are isolated within that sandbox—one application cannot access or alter another's memory or file storage. Neither can one application directly call another or access a shared data store—such as a list of contacts, for example. There are obvious reasons for this behavior; Microsoft must ensure that the Windows Phone 7 platform is as secure and stable as possible, and isolating applications is one giant step toward getting there.

There is a set of built-in APIs that provide access to the most common features of Windows Phone 7. These APIs help us perform tasks, such as saving a contact's e-mail address or phone number, or placing a phone call (with the mandatory prior user authorization, of course), that require access to shared resources on the phone.

Launchers and choosers, which can be thought of as system functions provided by the Windows Phone OS, provide you with the means to call into these applications. The difference between a launcher and a chooser is small but important: choosers provide a return value into the calling application, whereas launchers do not. If you think about a task of composing an e-mail message, for example, then it is sufficient to "fire and forget" an e-mail application, allowing users to create and send an e-mail. A launcher is an ideal solution for this task. On the other hand, an application allowing us to select a photo from the photo library on the phone needs to pass the selected photo to our application. Windows Phone 7 provides a chooser to perform such a task.

An important concept to remember is that launchers and choosers are separate applications. Since one of the core design principles behind Windows Phone 7 is to maximize battery life, only one application is allowed to execute on the phone at any time. Therefore, if you invoke a launcher or chooser from within your application, that launcher or chooser will replace your application and become the running application. Depending on the circumstances, your application may enter one of several states when that happens. Tables 1 and 2 list the launchers and choosers available on the Windows Phone 7 platform today. You'll find all of them in the Microsoft.Phone.Tasks namespace; therefore, to use any of them, be sure to import that namespace into your application.

1. Launchers

Table 1 lists launchers offered on the Windows Phone 7 platform, together with a brief description of functionality offered by each one of those launchers.

Table 1. Windows Phone 7 Launchers and Their Functions
LauncherFunction
EmailComposeTaskLaunch the e-mail application with a new message displayed.
MarketplaceDetailTaskLaunch the Windows Phone Marketplace client application and display the details page for the specified product.
MarketplaceHubTaskLaunch the Windows Phone Marketplace client application.
MarketplaceReviewTaskLaunch the Windows Phone Marketplace client application and display the review page for the specified product.
MarketplaceSearchTaskLaunch the Windows Phone Marketplace client application and display the search results from the specified search terms.
MediaPlayerLauncherLaunch the media player.
PhoneCallTaskLaunch the Phone application; use this to allow users to make a phone call from your application.
SaveEmailAddressTaskLaunch the Contacts application; use this to allow users to save an e-mail address from your application to a new or existing contact.
SavePhoneNumberTaskLaunch the Contacts application; use this to allow users to save a phone number from your application to a new or existing contact.
SearchTaskLaunch the Web Search application.
SmsComposeTaskLaunch the SMS application.
WebBrowserTaskLaunch the Web Browser application.

2. Choosers

Table 2 lists and describes the choosers available on the Windows Phone 7 platform.

Table 10.2. Windows Phone Choosers and Their Functions
ChooserFunction
EmailAddressChooserTaskLaunch the Contacts application and obtain the e-mail address of a contact selected by the user.
CameraCaptureTaskLaunch the Camera application and allow users to take a photo from your application.
PhoneNumberChooserTaskLaunch the Contacts application and obtain the phone number of a contact selected by the user.
PhotoChooserTaskLaunch the Photo Chooser application and select a photo .


Other  
  •  Java Mobile Edition Security : Development and Security Testing (part 3) - Code Security & Application Packaging and Distribution
  •  Java Mobile Edition Security : Development and Security Testing (part 2) - Reverse Engineering and Debugging
  •  Java Mobile Edition Security : Development and Security Testing (part 1) - Configuring a Development Environment and Installing New Platforms & Emulator
  •  Java Mobile Edition Security : Configurations, Profiles, and JSRs
  •  Programming the Mobile Web : Performance Optimization
  •  Programming the Mobile Web : Testing and Debugging (part 3) - Client-Side Debugging
  •  Programming the Mobile Web : Testing and Debugging (part 2) - Server-Side Debugging & Markup Debugging
  •  Programming the Mobile Web : Testing and Debugging (part 1) - Remote Labs
  •  Windows Phone 7 : Working with Controls and Themes - Adding Transition Effects
  •  Windows Phone 7 : Working with Controls and Themes - Understanding Frame and Page Navigation
  •  
    Top 10
    Free Mobile And Desktop Apps For Accessing Restricted Websites
    MASERATI QUATTROPORTE; DIESEL : Lure of Italian limos
    TOYOTA CAMRY 2; 2.5 : Camry now more comely
    KIA SORENTO 2.2CRDi : Fuel-sipping slugger
    How To Setup, Password Protect & Encrypt Wireless Internet Connection
    Emulate And Run iPad Apps On Windows, Mac OS X & Linux With iPadian
    Backup & Restore Game Progress From Any Game With SaveGameProgress
    Generate A Facebook Timeline Cover Using A Free App
    New App for Women ‘Remix’ Offers Fashion Advice & Style Tips
    SG50 Ferrari F12berlinetta : Prancing Horse for Lion City's 50th
    - Messages forwarded by Outlook rule go nowhere
    - Create and Deploy Windows 7 Image
    - How do I check to see if my exchange 2003 is an open relay? (not using a open relay tester tool online, but on the console)
    - Creating and using an unencrypted cookie in ASP.NET
    - Directories
    - Poor Performance on Sharepoint 2010 Server
    - SBS 2008 ~ The e-mail alias already exists...
    - Public to Private IP - DNS Changes
    - Send Email from Winform application
    - How to create a .mdb file from ms sql server database.......
    programming4us programming4us
    programming4us
     
     
    programming4us