27

PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Embed Size (px)

DESCRIPTION

Windows Phone 7 Applications on the Windows Azure Platform

Citation preview

Page 1: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform
Page 2: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Building Windows Phone 7 Applications with the Windows Azure Platform

Steve MarxTactical Strategist, Windows AzureMicrosoft Corporation

Twitter: @smarxBlog: blog.smarx.com

Page 3: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

PhoneConnectedPervasiveMarketplace

CloudCommon endpointScalableUtility billing

They make a great team.

Page 4: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Windows Phone 7and Windows Azure

Common development toolsEmulator for developmentComplementary application models

Phone: sometimes on, connectedCloud: always available, running

Page 5: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

This Talk

CommunicationDataIdentity

Windows Azure App

Page 6: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Doodle Joy

demo

Page 7: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Two Communication Models

Phone-initiated Cloud-initiated

Page 8: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Phone-Initiated Communication Options

HTTP-based, request/responseFramework choices (WCF, OData, WebRequest, …)Wire format choices (SOAP, JSON, POX, …)

Page 9: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Simple client-server communication

demo

Page 10: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Storing and Sharing Data in the Windows Azure Platform

SQL AzureFamiliar relational databaseHighly available, managed for youT-SQL

Windows Azure TablesNon-relational structured storageScale-out, billions of rowsOData

Windows Azure BlobsBig filesREST

Page 11: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Storing data in Windows Azure tables

demo

Page 12: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Windows Azure Blobs Pattern: Public Blobs1. Client sends data to web role2. Web role stores data in blobs3. Client fetches public blobs directly

WebRole

(1)

(2)(3)

Page 13: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Windows Azure Blobs Pattern: Shared Access Signatures

WebRole

1. Client gets Shared Access Signature from web role

2. Client stores data in blobs

3. Client fetches public blobs directly

(1)

(2) (3)

Page 14: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Using the Windows Azure Content Delivery Network

CDN

CDN

CDN

CDN

CDN

CDN

Page 15: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Using Windows Azure blobs

demo

Page 16: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Consider Occasionally-Connected Scenarios

Phone is occasionally connectedSynchronize data, cache locally

Sync Framework 4.0 October 2010 CTPSync with SQL Server or SQL Azure using a simple protocolSilverlight, WP7, WM6.5, HTML5, and other devicesSync logic on the server, thin clientsCTP now, RTW in 2011

Page 17: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Two Communication Models

Phone-initiated Cloud-initiated

Page 18: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Cloud-Initiated Communication

Push notificationsSingle connection between phone and Microsoft Push Notification serviceBandwidth- and battery-friendlyDelivery not guaranteed

Three kinds of push notifications:Raw – message to applicationToast – message to userTile – image, title, count

Page 19: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Push Notifications: Subscribing

1. Phone opens a channel

2. Phone sends URL to cloud

3. Cloud pushes notifications via URL

4. Microsoft Push Notification service notifies phone

MPNSWeb Role

(1)(2)

(3)

(4)

Page 20: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Sending push notifications

demo

Page 21: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Scaling Work in Windows Azure

1. Web role receives message

2. Web role enqueues work

3. Worker role polls queue

4. Worker role sends notifications

Worker rolesBasically, DLL with Main()Run foreverOften poll a queue

MPNS

Worker

Role

Web Role

(1)

(2)

(3)

(4)

Page 22: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Shared Identity Between Phone and Cloud

Identity optionsCreate your own (username, password)Borrow another identity system (Twitter, Facebook, your web site’s)

Using web-based log-inWebBrowser control can be embeddedWeb page can call back out to Silverlight codeFor an example, see “Identity and Access Control in the Cloud”

Be careful where you store secrets

Page 23: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Web-based authentication/authorization

demo

Page 24: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Summary

Windows Azure helps you build connected Windows Phone 7 Applications

Common development environment, complementary application models

Simple patterns for communication, data, and identity

Page 25: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Resources

My blog: http://blog.smarx.com (get the source code)WP7 kit: http://channel9.msdn.com/learn/courses/WP7TrainingKit/WA kit: http://channel9.msdn.com/learn/courses/Azure/P&P WP7 Guidance: http://wp7guide.codeplex.com/WA MSDN page: http://msdn.com/windowsazure

Fiddler and WP7 emulator: http://blogs.msdn.com/b/fiddler/archive/2010/10/15/fiddler-and-the-windows-phone-emulator.aspx

Page 26: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

Other Talks

IdentityIdentity and Access Control in the Cloud (Vittorio Bertocci)

Windows AzureWhat’s New in Windows Azure (Ori Amiga)Building High-Performance Web Applications with the WA Platform (Matt Kerner)Building, Deploying, & Managing Windows Azure Applications (Jim Nakashima)Windows Azure Storage Deep Dive (Jai Haridas)

Sync FrameworkBuilding Offline Apps Using the Sync Framework and SQL Azure (Nina Hu)

Reactive ExtensionsLINQ, Take Two: Realizing the LINQ to Everything Dream (Bart De Smet)

Page 27: PDC '10 - CD07 Steve Marx - Building Windows Phone 7 Applications with the Windows Azure Platform

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