Windows Phone 7Unleashed<br />Session II<br />
Session 2 Agenda<br />Navigation<br />Fragment Navigation<br />Web Services<br />JsonDeserialzation<br />Extras Menu<br />...
Navigation<br />
Phone Application Frame<br />Frame Contains Page Control and other elements<br />Page fills the entire content region of t...
Phone Application Page<br />A page fills the entire content region of the frame. It includes the following characteristics...
A Quick Lap around the Phone<br /><ul><li>Navigation
OnNavigatedTo override
Fragment Navigation
AppBar</li></ul>Demo<br />
Name<br />Title<br />Microsoft Corporation<br />Connecting to Web Services<br />
Classic Development<br />Forward Looking<br />Web + Services<br />Application <br />+<br /> Services<br />Application – Or...
Networking for Windows Phone<br />Support for networking features:<br />WCF<br />HttpWebRequest<br />WebClient<br />No cro...
Simple HTTP Request<br />12<br />WebClient client = newWebClient();<br />publicSimpleWebClient()<br />        {<br />Initi...
WCF ASMX Services<br />13<br />
Restful Web Services<br />Use WCF Restful Services <br />On Premise<br />As a Azure WebRole<br />Data<br />On premise<br /...
Using ODATA<br />From WCF<br />From SQL Azure<br />From publishers – http://odata.org<br />Odata Client Library for WP7 <b...
You Decide<br />Simple Test Case : Downloaded 8 data records<br />Each Record had just four fields<br />Measured bytes to ...
The Extras Menu<br />Add an xml file to project<br />17<br />
The Extras Menu<br />Name it Extras.xml<br />18<br />
The Extras Menu<br />Add the following xml<br />19<br />
A Quick Lap around the Phone<br /><ul><li>Connecting to Rest Service
Using Json(Data Contract Serializer)
Adding your app to the extras menu</li></ul>Demo<br />
Push Notifications<br />
Push Notification Service<br />Your Web Service<br />Custom Web Service<br />Windows Phone<br />Notification Service<br />...
PUSH NOTIFICATIONS: DATA FLOW<br />Push client<br />Tile<br />Toast<br />Open push channel<br />Return URI<br />Data to to...
Upcoming SlideShare
Loading in …5
×

Windows Phone 7 Unleashed Session 2

1,344 views
1,256 views

Published on

Special thanks to Daniel Egan. This presentation provides a deeper dive into Windows Phone 7 for developers. Topics cover how you navigate in your applicaton, how to access Web Services, use JSON to move data, and how to push notifications.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,344
On SlideShare
0
From Embeds
0
Number of Embeds
61
Actions
Shares
0
Downloads
14
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Windows Phone 7 Unleashed Session 2

  1. 1. Windows Phone 7Unleashed<br />Session II<br />
  2. 2. Session 2 Agenda<br />Navigation<br />Fragment Navigation<br />Web Services<br />JsonDeserialzation<br />Extras Menu<br />Push Notifications<br />Push Notifications Helper Library<br />Shell Tile Scheduler<br />Cloud Phone SDK<br />Bing Maps<br />
  3. 3. Navigation<br />
  4. 4. Phone Application Frame<br />Frame Contains Page Control and other elements<br />Page fills the entire content region of the frame and contains the content<br />
  5. 5. Phone Application Page<br />A page fills the entire content region of the frame. It includes the following characteristics:<br />Optionally surfaces its own application bar<br />There are three main ways to navigate between pages in your app:<br />Using the PhoneApplicationPagevirtual methods for handling the result of navigation. <br />HyperlinkButton- it provides NavigateUriproperty which can be used to navigate to a page Uri. <br />NavigationService- it provides methods, properties, and events to support navigation within a wp7 application. <br />Note: The PhoneApplicationPage class supports OnNavigatedTo, OnNavigatedFrom and OnNavigatingFrom virtual methods for handling the result of navigation:<br />
  6. 6.
  7. 7.
  8. 8. A Quick Lap around the Phone<br /><ul><li>Navigation
  9. 9. OnNavigatedTo override
  10. 10. Fragment Navigation
  11. 11. AppBar</li></ul>Demo<br />
  12. 12. Name<br />Title<br />Microsoft Corporation<br />Connecting to Web Services<br />
  13. 13. Classic Development<br />Forward Looking<br />Web + Services<br />Application <br />+<br /> Services<br />Application – Oriented around one device<br />(1 Screen)<br />Oriented around multiple devices (x Screens)<br />Shifting Development Strategies<br />
  14. 14. Networking for Windows Phone<br />Support for networking features:<br />WCF<br />HttpWebRequest<br />WebClient<br />No cross-domain policy file required<br />ODATA<br />Not Supported<br />Sockets<br />Custom WCF Bindings (no duplex)<br />WCF RIA Services<br />NTLM authentication<br />
  15. 15. Simple HTTP Request<br />12<br />WebClient client = newWebClient();<br />publicSimpleWebClient()<br /> {<br />InitializeComponent();<br />client.DownloadProgressChanged += newDownloadProgressChangedEventHandler(client_DownloadProgressChanged);<br />client.DownloadStringCompleted += newDownloadStringCompletedEventHandler(client_DownloadStringCompleted);<br /> }<br />privatevoid button1_Click(object sender, RoutedEventArgs e)<br /> {<br />client.DownloadStringAsync(<br />newUri("http://localhost/ServicesApplication/whatever.xml"), "sample rss");<br /> }<br />voidclient_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)<br /> {<br />if (e.UserStateasstring == "sample rss") <br /> {<br />this.progressBar1.Value = e.ProgressPercentage;<br /> }<br /> }<br />voidclient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)<br /> {<br />this.textBlock1.Text = e.Result;<br /> }<br />
  16. 16. WCF ASMX Services<br />13<br />
  17. 17. Restful Web Services<br />Use WCF Restful Services <br />On Premise<br />As a Azure WebRole<br />Data<br />On premise<br />In Cloud<br />Retrieve Lightweight rest services<br />XML<br />JSON<br />14<br />
  18. 18. Using ODATA<br />From WCF<br />From SQL Azure<br />From publishers – http://odata.org<br />Odata Client Library for WP7 <br />15<br />
  19. 19. You Decide<br />Simple Test Case : Downloaded 8 data records<br />Each Record had just four fields<br />Measured bytes to transfer:<br />Odata version from WCF Data Services<br />8.5k<br />ASMX SOAP + Dataset - 3k<br />REST + XML - 1.2k<br />REST + JSON – 639bytes<br />16<br />
  20. 20. The Extras Menu<br />Add an xml file to project<br />17<br />
  21. 21. The Extras Menu<br />Name it Extras.xml<br />18<br />
  22. 22. The Extras Menu<br />Add the following xml<br />19<br />
  23. 23. A Quick Lap around the Phone<br /><ul><li>Connecting to Rest Service
  24. 24. Using Json(Data Contract Serializer)
  25. 25. Adding your app to the extras menu</li></ul>Demo<br />
  26. 26. Push Notifications<br />
  27. 27. Push Notification Service<br />Your Web Service<br />Custom Web Service<br />Windows Phone<br />Notification Service<br />Existing Web Services<br />Microsoft Services<br />Microsoft.Phone.Notification<br />Push client service<br />Built-in support for efficient, battery-aware mobile push notifications<br />Managed APIs for notification-driven interaction with existing Web 2.0 sites<br />
  28. 28. PUSH NOTIFICATIONS: DATA FLOW<br />Push client<br />Tile<br />Toast<br />Open push channel<br />Return URI<br />Data to toast<br />Data to tile<br />Data to App<br />App<br />Send URI to server<br />Send push data to client<br />Push service<br />Your service<br />Event<br />Send push data to URI<br />
  29. 29. Push Notification Service<br />Seattle, WA: Sunny and 85 degrees<br />
  30. 30. Shell Tile Scheduler<br />25<br />
  31. 31. Shell Tile Scheduler<br />26<br />
  32. 32. A Quick Lap around the Phone<br /><ul><li>Push Notification Helper
  33. 33. ScheduleTileService</li></ul>Demo<br />
  34. 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.<br />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. <br />MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.<br />

×