Top Banner
Launcher s and Choosers Jason Lee Ethos Technologie
13

05 wp7 launchers and choosers

May 21, 2015

Download

Education

Tao Wang
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 05 wp7   launchers and choosers

Launchersand

Choosers

Jason LeeEthos Technologies

Page 2: 05 wp7   launchers and choosers

Agenda• Introduction• Full List• Code Example• Execution Model• Event Flow• Play Time• Q & A

Page 3: 05 wp7   launchers and choosers

Launchers & Choosers• Windows Phone provides a number of functions

• Telephone Call, SMS, Email, Camera, Contacts etc.

• Indirect access to phone features & data• Applications can NOT directly access information such as contacts.• Applications can NOT directly execute behaviors such as phone call or

SMS. • Launchers & Choosers allow applications to access various phone features

and data through them.

• They invoke new applications• Launcher & Chooser APIs invoke distinct built-in applications (which in

turn replace the currently running application, and can go back by hitting Back key)

Page 4: 05 wp7   launchers and choosers

Launcher• A Launcher

• Launches one of the built-in applications through which a user can complete a certain task

• No data is returned to calling application• Examples :

- PhoneCallTask- SMSComposeTask

Page 5: 05 wp7   launchers and choosers

Chooser• A Chooser

• Also launches one of the built-in applications through which a user can complete a certain task

• Returns some data to calling application• When a chooser completes, calling application is reactivated and supplied

with the result• A user can cancel the launcher, in which case an empty value is returned• Examples :

- PhoneNumberChooserTask- PhotoChooserTask

Page 6: 05 wp7   launchers and choosers

Full ListLaunchers

EmailComposeTask

MarketplaceDetailTask

MarketplaceHubTask

MarketplaceReviewTask

MarketplaceSearchTask

MediaPlayerLauncher

PhoneCallTask

SearchTask

SMSComposeTask

WebBrowserTask

Choosers

CameraCaptureTask

EmailAddressChooserTask

PhoneNumberChooserTask

PhotoChooserTask

SaveEmailAddressTask

SavePhoneNumberTask

Page 7: 05 wp7   launchers and choosers

Using Launchers• Key Points

• Different launchers has different parameters• They all have a Show() method to invoke tasks

• Example 1

• Example 2

Page 8: 05 wp7   launchers and choosers

Using Choosers• Key Points

• Hook to a Chooser’s Completed event for result data• Use Show() method to invoke tasks

• Example

Page 9: 05 wp7   launchers and choosers

Execution Model• When Launchers & Choosers are hit

• OnNavigatedFrom event occurs to the page• Deactivated event occurs to the App• Control switches to the task

• While Launchers & Choosers running• There’s no guarantee that the user will come back to your app• If the user navigates away from the task, your app will be dormant, and

therefore has a possibility to be tombstoned eventually• Thus, every stateful application should handle tombstoning

• After Launchers & Choosers complete• Activated event occurs to App• OnNavigatedTo event occurs to the page• The app and page are the same instances if not tombstoned, new

instances if tombstoned.

Page 10: 05 wp7   launchers and choosers

Event Flow

App

• Without TombstoningPage Task

App()

Launching

Deactivated

Activated

Page()

OnNavigatedTo

OnNavigatedFrom

OnNavigatedTo

Show()

Completed

Do Something

Page 11: 05 wp7   launchers and choosers

Event Flow

App

• With TombstoningPage Task

App()Launching

Deactivated

Activated

Page()OnNavigatedTo

OnNavigatedFrom

OnNavigatedTo

Show()

App()

Navigates Awayand

Come Back

Page()

Completed Event does NOT occur

Page 12: 05 wp7   launchers and choosers

Play Time !• Goals

• Get familiar with various Launchers and Choosers• Understand application lifecycle event flow related to Launchers and

Choosers

Page 13: 05 wp7   launchers and choosers

! & ?

Thank You ! Any Questions ?