SlideShare a Scribd company logo
Windows Phone 7UnleashedSession II
Session 2 AgendaNavigationFragment NavigationWeb ServicesJsonDeserialzationExtras MenuPush NotificationsPush Notifications Helper LibraryShell Tile SchedulerCloud Phone SDKBing Maps
Navigation
Phone Application FrameFrame Contains Page Control and other elementsPage fills the entire content region of the frame and contains the content
Phone Application PageA page fills the entire content region of the frame. It includes the following characteristics:Optionally surfaces its own application barThere are three main ways to navigate between pages in your app:Using the PhoneApplicationPagevirtual methods for handling the result of navigation. HyperlinkButton- it provides NavigateUriproperty which can be used to navigate to a page Uri. NavigationService- it provides methods, properties, and events to support navigation within a wp7 application. Note: The PhoneApplicationPage class supports OnNavigatedTo, OnNavigatedFrom and OnNavigatingFrom virtual methods for handling the result of navigation:
Windows Phone 7 Unleashed Session 2
Windows Phone 7 Unleashed Session 2
A Quick Lap around the PhoneNavigation
OnNavigatedTo override
Fragment Navigation
AppBarDemo
NameTitleMicrosoft CorporationConnecting to Web Services
Classic DevelopmentForward LookingWeb + ServicesApplication + ServicesApplication – Oriented around one device(1 Screen)Oriented around multiple devices (x Screens)Shifting Development Strategies
Networking for Windows PhoneSupport for networking features:WCFHttpWebRequestWebClientNo cross-domain policy file requiredODATANot SupportedSocketsCustom WCF Bindings (no duplex)WCF RIA ServicesNTLM authentication
Simple HTTP Request12WebClient client = newWebClient();publicSimpleWebClient()        {InitializeComponent();client.DownloadProgressChanged += newDownloadProgressChangedEventHandler(client_DownloadProgressChanged);client.DownloadStringCompleted += newDownloadStringCompletedEventHandler(client_DownloadStringCompleted);        }privatevoid button1_Click(object sender, RoutedEventArgs e)        {client.DownloadStringAsync(newUri("http://localhost/ServicesApplication/whatever.xml"), "sample rss");        }voidclient_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)        {if (e.UserStateasstring == "sample rss")             {this.progressBar1.Value = e.ProgressPercentage;            }        }voidclient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)        {this.textBlock1.Text = e.Result;        }
WCF ASMX Services13
Restful Web ServicesUse WCF Restful Services On PremiseAs a Azure WebRoleDataOn premiseIn CloudRetrieve Lightweight rest servicesXMLJSON14
Using ODATAFrom WCFFrom SQL AzureFrom publishers – http://odata.orgOdata Client Library for WP7 15
You DecideSimple Test Case : Downloaded 8 data recordsEach Record had just four fieldsMeasured bytes to transfer:Odata version from WCF Data Services8.5kASMX SOAP + Dataset - 3kREST + XML  - 1.2kREST + JSON – 639bytes16
The Extras MenuAdd an xml file to project17
The Extras MenuName it Extras.xml18
The Extras MenuAdd the following xml19
A Quick Lap around the PhoneConnecting to Rest Service
Using Json(Data Contract Serializer)
Adding your app to the extras menuDemo
Push Notifications
Push Notification ServiceYour Web ServiceCustom Web ServiceWindows PhoneNotification ServiceExisting Web ServicesMicrosoft ServicesMicrosoft.Phone.NotificationPush client serviceBuilt-in support for efficient, battery-aware mobile push notificationsManaged APIs for notification-driven interaction with existing Web 2.0 sites
PUSH NOTIFICATIONS: DATA FLOWPush clientTileToastOpen push channelReturn URIData to toastData to tileData to AppAppSend URI to serverSend push data to clientPush serviceYour serviceEventSend push data to URI

More Related Content

Windows Phone 7 Unleashed Session 2

  • 2. Session 2 AgendaNavigationFragment NavigationWeb ServicesJsonDeserialzationExtras MenuPush NotificationsPush Notifications Helper LibraryShell Tile SchedulerCloud Phone SDKBing Maps
  • 4. Phone Application FrameFrame Contains Page Control and other elementsPage fills the entire content region of the frame and contains the content
  • 5. Phone Application PageA page fills the entire content region of the frame. It includes the following characteristics:Optionally surfaces its own application barThere are three main ways to navigate between pages in your app:Using the PhoneApplicationPagevirtual methods for handling the result of navigation. HyperlinkButton- it provides NavigateUriproperty which can be used to navigate to a page Uri. NavigationService- it provides methods, properties, and events to support navigation within a wp7 application. Note: The PhoneApplicationPage class supports OnNavigatedTo, OnNavigatedFrom and OnNavigatingFrom virtual methods for handling the result of navigation:
  • 8. A Quick Lap around the PhoneNavigation
  • 13. Classic DevelopmentForward LookingWeb + ServicesApplication + ServicesApplication – Oriented around one device(1 Screen)Oriented around multiple devices (x Screens)Shifting Development Strategies
  • 14. Networking for Windows PhoneSupport for networking features:WCFHttpWebRequestWebClientNo cross-domain policy file requiredODATANot SupportedSocketsCustom WCF Bindings (no duplex)WCF RIA ServicesNTLM authentication
  • 15. Simple HTTP Request12WebClient client = newWebClient();publicSimpleWebClient() {InitializeComponent();client.DownloadProgressChanged += newDownloadProgressChangedEventHandler(client_DownloadProgressChanged);client.DownloadStringCompleted += newDownloadStringCompletedEventHandler(client_DownloadStringCompleted); }privatevoid button1_Click(object sender, RoutedEventArgs e) {client.DownloadStringAsync(newUri("http://localhost/ServicesApplication/whatever.xml"), "sample rss"); }voidclient_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) {if (e.UserStateasstring == "sample rss") {this.progressBar1.Value = e.ProgressPercentage; } }voidclient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) {this.textBlock1.Text = e.Result; }
  • 17. Restful Web ServicesUse WCF Restful Services On PremiseAs a Azure WebRoleDataOn premiseIn CloudRetrieve Lightweight rest servicesXMLJSON14
  • 18. Using ODATAFrom WCFFrom SQL AzureFrom publishers – http://odata.orgOdata Client Library for WP7 15
  • 19. You DecideSimple Test Case : Downloaded 8 data recordsEach Record had just four fieldsMeasured bytes to transfer:Odata version from WCF Data Services8.5kASMX SOAP + Dataset - 3kREST + XML - 1.2kREST + JSON – 639bytes16
  • 20. The Extras MenuAdd an xml file to project17
  • 21. The Extras MenuName it Extras.xml18
  • 22. The Extras MenuAdd the following xml19
  • 23. A Quick Lap around the PhoneConnecting to Rest Service
  • 25. Adding your app to the extras menuDemo
  • 27. Push Notification ServiceYour Web ServiceCustom Web ServiceWindows PhoneNotification ServiceExisting Web ServicesMicrosoft ServicesMicrosoft.Phone.NotificationPush client serviceBuilt-in support for efficient, battery-aware mobile push notificationsManaged APIs for notification-driven interaction with existing Web 2.0 sites
  • 28. PUSH NOTIFICATIONS: DATA FLOWPush clientTileToastOpen push channelReturn URIData to toastData to tileData to AppAppSend URI to serverSend push data to clientPush serviceYour serviceEventSend push data to URI
  • 29. Push Notification ServiceSeattle, WA: Sunny and 85 degrees
  • 32. A Quick Lap around the PhonePush Notification Helper
  • 34. © 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.