An end-to-end experience of Windows Phone 7 development (Part 2)

41

description

DevDays 2011 South Africa - An end-to-end experience of Windows Phone 7 development (Part 2)

Transcript of An end-to-end experience of Windows Phone 7 development (Part 2)

Page 1: An end-to-end experience of Windows Phone 7 development (Part 2)
Page 2: An end-to-end experience of Windows Phone 7 development (Part 2)

Rudi Groblerhttp://www.rudigrobler.net@rudigrobler

An end-to-end experience of Windows Phone 7 development

TRACK: NEXT GENERATION

Page 3: An end-to-end experience of Windows Phone 7 development (Part 2)

agenda

Two part sessionThe basics

Build app from File -> New…Advanced tips and tricks

Loads of contentCaveat: this is NOT a marketing session on how cool the phone is… This is how to build a application end-to-end

Feel free to ask questions ANY time...

Windows Phone 7 App Smackdown

PollAndroid

iPhone

Silverlight/WPF

Other

Page 4: An end-to-end experience of Windows Phone 7 development (Part 2)

applications

OmoplataScrumy7PodiumProfessional Audio Recorder7MC GoferBrew Master

Page 5: An end-to-end experience of Windows Phone 7 development (Part 2)

Brew Master

demo

Page 6: An end-to-end experience of Windows Phone 7 development (Part 2)

hardware foundation

Capacitive touch4 or more contact points

SensorsA-GPS, Accelerometer, Compass, Light, Proximity

Camera5 mega pixels or more

MultimediaCommon detailed specs, Codec acceleration

Memory256MB RAM or more, 8GB Flash or more

GPUDirectX 9 acceleration

CPUQualcomm MSM8x55 1Ghz (800Mhz) or higher

Hardware buttons | Back, Start, Search

480

80

0

Qualcomm MSM7x30 & Gyroscope

Page 7: An end-to-end experience of Windows Phone 7 development (Part 2)

common platform capabilities

.NETSuperset of Silverlight 3.0

InputTouchHardware buttons

MediaDigital media capture & playbackMedia library access

DataIsolated storageLINQ

ObjectXML

WCFSOAP & REST services

Phone AccessIntegrated access to phone UISensorsPickers for contacts and photos

Integrated with Cloud ServicesApp deployment & UpdatesNotificationsLocationXbox LIVE

Page 8: An end-to-end experience of Windows Phone 7 development (Part 2)

Two flavours of applications

Silverlight

Modern XAML/event-driven application UI frameworkRapid creation of visual stunning applicationsMetro-themed UI controls500,000 developers spanning Windows and web

XNA

High performance game frameworkRapid creation of multi-screen 2D & 3D gamesRich content pipelineMature, robust, widely adopted technology spanning Xbox 360, Windows and Zune

XNA/Silverlight Interop

Page 9: An end-to-end experience of Windows Phone 7 development (Part 2)

silverlight for windows phone

Silverlight for Windows Phone is…Silverlight 3minus a few things that didn’t make senseplus a few Silverlight 4 things that didplus phone specific API & “under the hood” improvements

Silverlight 4 compatibility (1500+ new APIs)

Page 10: An end-to-end experience of Windows Phone 7 development (Part 2)

Getting started…

demo

Page 11: An end-to-end experience of Windows Phone 7 development (Part 2)

navigation

Applications are built like web sitesFunctionality is split into pagesForward navigation via linksBackward navigation via Back

Previous applications (pages) are in the back stackCan override back button behavior (but be careful)

Transient pages

Payload can be send with navigation request

NO back to home buttons!!!

Deep linking

Page 12: An end-to-end experience of Windows Phone 7 development (Part 2)

Navigation

demo

Page 13: An end-to-end experience of Windows Phone 7 development (Part 2)

familiar web concepts

Phone applicationProvides UI represented as XAML pages connected into cross-app flows by URI’s

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

Page 14: An end-to-end experience of Windows Phone 7 development (Part 2)

launchers and choosers

Windows Phone execution model isolates every application in its own sandbox

Apps cannot directly access information stores such as contactsCannot directly invoke other applications such as phone or messaging

Launchers and Choosers allow applications indirect access to the useful phone featuresLaunchers and Choosers APIs invoke distinct built-in applications that replace the currently running applications

Page 15: An end-to-end experience of Windows Phone 7 development (Part 2)

launchers and choosers

LauncherLaunches one of the built-in applications though which a use completes a taskNo data is returned to calling applicationExample: PhoneCallTask

ChooserLaunches one of the built-in applications through which a user completes a task and which returns some data to calling applicationWhen caller completes, calling application is activated and supplied with the Chooser resultExample: PhotoChooserTask

Page 16: An end-to-end experience of Windows Phone 7 development (Part 2)

launchers and choosers

Launchers

EmailComposeTaskMediaPlayerLauncherPhoneCallTaskSearchTaskSMSComposeTaskWebBrowserTaskMarketplaceDetailTaskMarketplaceHubTaskMarketplaceReviewTaskMarketplaceSearchTask

Choosers

CameraCaptureTaskEmailAddressChooserTaskPhoneNumberChooserTaskPhotoChooserTaskSaveEmailAddressTaskSavePhoneNumberTask

Bing

Page 17: An end-to-end experience of Windows Phone 7 development (Part 2)

Launchers and Choosers

demo

Page 18: An end-to-end experience of Windows Phone 7 development (Part 2)

choosers and the execution model

IMPORTANT! When you launch a Launcher or Chooser, your app is terminated

When task completes, your app may be reactivated and a new app instance created (SOMETIMES)

The following choosers and tasks have relaxed thombstoning policy

PhotoChooserTaskCameraCaptureTaskMediaPlayerLaunchTaskEmailAddressChooserPhoneNumberChoose

Page 19: An end-to-end experience of Windows Phone 7 development (Part 2)

panoramas

Page 20: An end-to-end experience of Windows Phone 7 development (Part 2)

panoramas

Page 21: An end-to-end experience of Windows Phone 7 development (Part 2)

pivots

Page 22: An end-to-end experience of Windows Phone 7 development (Part 2)

panorama vs pivot

Pivot

Filter same data on different views (the “inbox” is a great example of this) Optimized for current screen size Filter of data doesn’t have to be same view (agenda/day) Related content is ok to pivot on as long as related content is truly related Focused “Virtualized”

Panorama

Horizontal broad canvas, not confined to current screen size A ‘top layer’ view into underlying experiences/tasks Use white space Performance -> Panorama loads all the pages on startupExploratory in nature

Page 23: An end-to-end experience of Windows Phone 7 development (Part 2)

Adding and using the Pivot

demo

Page 24: An end-to-end experience of Windows Phone 7 development (Part 2)

misuse of common controls

Use the WP7 common controls appropriately.

Don’t use sliders, toggles or map controls under panoramas or pivots –as they both need the same gestures to work.

Page 25: An end-to-end experience of Windows Phone 7 development (Part 2)

MVVM on the Phone

Model PhoneApplicationPageViewModel PhoneApplicationPag

ePhoneApplicationPag

ePhoneApplicationPag

eView

App.xaml

Data Bindable propertiesBusiness logic

PhoneApplicationFramePhoneApplicationPageControlsCode-behind

Singleton

Wanna learn more? Check out Silverlight Kung-fu Starting 16:30 @ track 3

Page 26: An end-to-end experience of Windows Phone 7 development (Part 2)

MVVM phone style…

demo

Page 27: An end-to-end experience of Windows Phone 7 development (Part 2)

networking on the phone

Support for networking featuresWCF/ASMXHttpWebRequestWebClientNo cross-domain policy file required

Not supportedSocketsCustom WCF BindingsWCF RIA ServicesNTLM authentication

Page 28: An end-to-end experience of Windows Phone 7 development (Part 2)

WCF/ASMX services

Can “Add Reference” from Windows Phone projects to automatically generate proxy classes

ASMX should just workWCF requires that you use basicHttpBinding

Page 29: An end-to-end experience of Windows Phone 7 development (Part 2)

OData

Server:WCF Data Services provides an extensible tool for publishing data using REST based interface

Publishes and consumes data using Odata web protocolFormat is XML or JSON

Client:Download Odata Client Library for Windows Phone

http://odata.codeplex.com/

FULL parity with Silverlight (Including LINQ and Add Service Reference support)

Page 30: An end-to-end experience of Windows Phone 7 development (Part 2)

Getting data

demo

Page 31: An end-to-end experience of Windows Phone 7 development (Part 2)

HTTPWebRequest vs WebClient

Use HttpWebRequest whenever possibleUse background thread and marshal back to UI thread (Using Dispatcher.BeginInvoke)

WebClient is “easier” to use but happens on the UI thread no matter where it was spawned (Bug)6 Parallel requests limit

WebClient bug fixed

Page 32: An end-to-end experience of Windows Phone 7 development (Part 2)

marketplace

Enhanced DiscoveryEasy to find great applications & gamesFun to browse the marketplace

Simple & Reliable AcquisitionTry before you buyBuying and downloading content is a breezePayment flexibility (Monthly billing and credit card)Easy application updates

South Africa WILL BE supported…

Page 33: An end-to-end experience of Windows Phone 7 development (Part 2)

marketplace

It costs nothing to download the Windows Phone SDK and write code using the emulatorTo sell applications you need to register as a developer

This costs $99 a year and allows you to publish any number of fee applications and up to 99 free applications

Each additional application costs $20

Students can sign up for freeRevenue sharing (30/70)

Page 34: An end-to-end experience of Windows Phone 7 development (Part 2)

yalla apps

Are you looking for a viable alternative to publish your WP7 Apps to the Windows Phone Marketplace? Yalla Apps provides the solution by publishing your apps to the Marketplace on your behalf.

Publish your apps to the Windows Phone marketplaceand unlock your device for testingShare and download code in the Module MarketSmooth certification processJoin the developer community

Page 35: An end-to-end experience of Windows Phone 7 development (Part 2)

yalla apps

Device UnlockingYalla Apps offers a device unlock service which allows you to unlock your Windows Phone 7 to debug and test applications. The device unlock is accomplished using remote assistance access to your development machine and charged 0 Credits for the first device and 50 credits per additional device.

Updated

CostSubmission - Free 1 Credits

Submission - Paid 0 Credits

25 Credits USD $25

50 Credits USD $45

100 Credits USD $80

Page 36: An end-to-end experience of Windows Phone 7 development (Part 2)

Yalla Apps

demo

Page 37: An end-to-end experience of Windows Phone 7 development (Part 2)

Slides, demos, etc…

@rudigrobler

http://www.rudigrobler.net

questions

Page 38: An end-to-end experience of Windows Phone 7 development (Part 2)

Don’t forget the Xbox Kinect show-down

after sessions this evening!

Page 39: An end-to-end experience of Windows Phone 7 development (Part 2)

DevDays 2011 Sponsors

PLATINUM SPONSORwww.bbd.co.za

SILVER SPONSORwww.dvt.co.za

SILVER SPONSORwww.ctutraining.co.za

Page 40: An end-to-end experience of Windows Phone 7 development (Part 2)

Keep in Touch

facebook.com/msdevsa

@msdevsa

http://blogs.msdn.com/southafrica

Page 41: An end-to-end experience of Windows Phone 7 development (Part 2)

© 2008 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.