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

Preview:

DESCRIPTION

Windows Phone 7 Applications on the Windows Azure Platform

Citation preview

Building Windows Phone 7 Applications with the Windows Azure Platform

Steve MarxTactical Strategist, Windows AzureMicrosoft Corporation

Twitter: @smarxBlog: blog.smarx.com

PhoneConnectedPervasiveMarketplace

CloudCommon endpointScalableUtility billing

They make a great team.

Windows Phone 7and Windows Azure

Common development toolsEmulator for developmentComplementary application models

Phone: sometimes on, connectedCloud: always available, running

This Talk

CommunicationDataIdentity

Windows Azure App

Doodle Joy

demo

Two Communication Models

Phone-initiated Cloud-initiated

Phone-Initiated Communication Options

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

Simple client-server communication

demo

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

Storing data in Windows Azure tables

demo

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)

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)

Using the Windows Azure Content Delivery Network

CDN

CDN

CDN

CDN

CDN

CDN

Using Windows Azure blobs

demo

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

Two Communication Models

Phone-initiated Cloud-initiated

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

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)

Sending push notifications

demo

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)

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

Web-based authentication/authorization

demo

Summary

Windows Azure helps you build connected Windows Phone 7 Applications

Common development environment, complementary application models

Simple patterns for communication, data, and identity

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

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)

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

Recommended