7 David Isbitski Sr. Developer Evangelist CoolStuffWith.Net @theDaveDev [email protected] Apps with Silverlight
Nov 14, 2014
Got an App idea. Now what?
Agenda
Calling a Web Service
What makes a WP7 app?
Layout and UI
Navigation and Back Button
App Lifecycle and State
Agenda
Monetize with PubCenter Ads
Application Bar
Tasks - Marketplace
Any Additional Gotchas
Why Windows Phone 7?
App Layout & UI
DEFAULT CONTROL TEMPLATES
Simple and elegant
Over-sized hit targets
Heavy use of transparency
THEMING Enables user to personalize their phone
Dark and light themes, each with several accent colors
Built-in controls are automatically themed
Applications can take advantage of theme values
Part 1 – App Layout & UI
External Data
Bing 2.0 APIs
Free, easy to use Web Service
Portal http://bing.com/developers
Classes BingService SearchRequest SourceTypes
Part 2 – Bing Search API 2.0
Page Navigation
Phone applicationProvides UI represented as XAML pages connected into cross-app flows by URI’s
UI Model: Familiar Web Concepts
Web applicationProvide media represented as HTTP resources linked by URL’s
Shell frameRequests pages, renders UI, and handles navigation across apps
Sessions and back stackGroups together sequences of pages corresponding to a user’s activity across apps
Web browserRequests HTTP resources, renders them, and handles navigation across sites
History and tabsGroups together sequences of HTTP resources corresponding to a user’s activity across sites
Retained in shell frame to support resuming paused
sessions
Discarded while the session is paused
UI and State Management: Concepts
Page UIDescribes the visual
appearance of a page
Page StateContains data that
describes an instance of a page,
analogous to browser cookie
19
Back Button is important!
• Only way to exit an App
• Page Navigation – avoid circular references
• Multi-Tasking (Mango)
Application Lifecycle
App Lifecycle Tombstoning
Your application has lost focus This can happen for a couple of reasons:
Back Button, Start Button, User clicked on a Push Notification, a Task is called, Phone Call
Found in App.xaml.cs Events to Handle
Application_Launching, Application_Activated, Application_Deactivated, Application_Closing
App State - Storage Isolated Storage
Settings and Custom Data Secure and Sandboxed Logical Folder Structure via APIs No quota currently
Be responsible and inform/empower user Session State
PhoneApplicationService.Current.State Goes away on App exit or lost focus
Part 3 – Navigation & State
Application Bar
AppBar Toolbar
Up to 4 icons Can set transparency level Slide up Menu can display more items
Can declare in code or XAML Built in support in Blend!
Found under Program Files\Microsoft SDKs\Windows Phone\v7.0\Icons
AppBar Icons
48 pixels by 48 pixels
White foreground on a transparent
background
Using alpha channel.
Icon get colorized to current style
Circle will be added
Part 4 – Application Bar
Tasks
Tasks - Launchers and Choosers Launcher
Launches one of the built-in applications through which a user completes a task
No data is returned to calling application Example: PhoneCallTask
Chooser Launches one of the built-in applications through which
a user completes a task, and which returns some data to calling application
When caller completes, calling application is activated and supplied with the Chooser result
Example: PhotoChooserTask
29
Launchers & ChoosersLaunchers EmailComposeTask MarketplaceDetailTask MarketplaceHubTask MarketplaceReviewTas
k MarketplaceSearchTas
k MediaPlayerLauncher PhoneCallTask SearchTask SMSComposeTask WebBrowserTask
Choosers CameraCaptureTask EmailAddressChooserT
ask PhoneNumberChooser
Task PhotoChooserTask SaveEmailAddressTask SavePhoneNumberTas
k
Part 5 – Marketplace Task
AppHub & PubCenter
Part 6 – Monetize with Ads
Any additional gotchas?
Supports Themes AppBar Icons GPS Privacy
Back Button Tech Contact Info
Marketplace Screenshots
No Native Code
(Shared Libs)
App State (Tombstonin
g)
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.
MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.