210 likes | 417 Views
Building Windows Phone 7 Applications with the Windows Azure Platform. Bijoy Singhal │ Developer Evangelist, Microsoft India. Phone Connected Pervasive Marketplace. Cloud Common endpoint Scalable Utility billing. They make a great team. Windows Phone 7 and Windows Azure.
E N D
Building Windows Phone 7 Applications with the Windows Azure Platform Bijoy Singhal │ Developer Evangelist, Microsoft India
Phone Connected Pervasive Marketplace Cloud Common endpoint Scalable Utility billing They make a great team.
Windows Phone 7and Windows Azure • Common development tools • Emulator for development • Complementary application models • Phone: sometimes on, connected • Cloud: always available, running
This Talk • Communication • Data Windows Azure App
Cloud-initiated Two Communication Models • Phone-initiated
Phone-Initiated Communication Options • HTTP-based, request/response • Framework choices (WCF, OData, WebRequest, …) • Wire format choices (SOAP, JSON, POX, …)
Storing and Sharing Data in the Windows Azure Platform • SQL Azure • Familiar relational database • Highly available, managed for you • T-SQL • Windows Azure Tables • Non-relational structured storage • Scale-out, billions of rows • OData • Windows Azure Blobs • Big files • REST
Windows Azure Blobs Pattern: Public Blobs • Client sends data to web role • Web role stores data in blobs • Client fetches public blobs directly (2) Web Role (3) (1)
Windows Azure Blobs Pattern: Shared Access Signatures • Client gets Shared Access Signature from web role • Client stores data in blobs • Client fetches public blobs directly Web Role (2) (3) (1)
Consider Occasionally-Connected Scenarios • Phone is occasionally connected • Synchronize data, cache locally • Sync Framework 4.0 October 2010 CTP • Sync with SQL Server or SQL Azure using a simple protocol • Silverlight, WP7, WM6.5, HTML5, and other devices • Sync logic on the server, thin clients • CTP now, RTW in 2011
Cloud-initiated Two Communication Models • Phone-initiated
Cloud-Initiated Communication • Push notifications • Single connection between phone and Microsoft Push Notification service • Bandwidth- and battery-friendly • Delivery not guaranteed • Three kinds of push notifications: • Raw – message to application • Toast – message to user • Tile – image, title, count
Push Notifications: Subscribing • Phone opens a channel • Phone sends URL to cloud • Cloud pushes notifications via URL • Microsoft Push Notification service notifies phone MPNS Web Role (3) (2) (1) (4)
Scaling Work in Windows Azure (2) • Web role receives message • Web role enqueues work • Worker role polls queue • Worker role sends notifications • Worker roles • Basically, DLL with Main() • Run forever • Often poll a queue (4) Worker Role Web Role MPNS (3) (1)
Shared Identity Between Phone and Cloud • Identity options • Create your own (username, password) • Borrow another identity system (Twitter, Facebook, your web site’s) • Using web-based log-in • WebBrowser control can be embedded • Web page can call back out to Silverlight code • For an example, see “Identity and Access Control in the Cloud” • Be careful where you store secrets
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 • Steve Marx’s 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
CREDITS Steve Marx (www.smarx.com)