windows phone 7 unleashed session 2
DESCRIPTION
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.TRANSCRIPT
![Page 1: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/1.jpg)
7
Windows Phone 7
Unleashed
Session II
![Page 2: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/2.jpg)
Session 2 Agenda
Navigation Fragment Navigation Web Services Json Deserialzation Extras Menu Push Notifications Push Notifications Helper Library Shell Tile Scheduler Cloud Phone SDK Bing Maps
![Page 3: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/3.jpg)
Navigation
![Page 4: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/4.jpg)
Phone Application Frame
Frame Contains Page Control and other elements
Page fills the entire content region of the frame and contains the content
![Page 5: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/5.jpg)
Phone Application Page
A page fills the entire content region of the frame. It includes the following characteristics:
Optionally surfaces its own application bar There are three main ways to navigate between pages in your
app: Using the PhoneApplicationPage virtual methods for handling the result of
navigation. HyperlinkButton - it provides NavigateUri property 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:
![Page 6: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/6.jpg)
![Page 7: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/7.jpg)
![Page 8: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/8.jpg)
A Quick Lap around the Phone• Navigation• OnNavigatedTo override• Fragment Navigation• AppBar
Demo
![Page 9: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/9.jpg)
NameTitleMicrosoft Corporation
Connecting to Web Services
![Page 10: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/10.jpg)
10 Microsoft Confidential
Classic Development
Forward Looking
Web + Services
Application +
Services
Oriented around multiple
devices (x Screens)
Application – Oriented
around one device
(1 Screen)
Shifting Development Strategies
![Page 11: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/11.jpg)
Networking for Windows Phone
Support for networking features: WCF HttpWebRequest WebClient No cross-domain policy file required ODATA
Not Supported Sockets Custom WCF Bindings (no duplex) WCF RIA Services NTLM authentication
![Page 12: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/12.jpg)
12
Simple HTTP Request
WebClient client = new WebClient();
public SimpleWebClient() { InitializeComponent();
client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged); client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);
}
private void button1_Click(object sender, RoutedEventArgs e) { client.DownloadStringAsync( new Uri("http://localhost/ServicesApplication/whatever.xml"), "sample rss");
}
void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) { if (e.UserState as string == "sample rss") { this.progressBar1.Value = e.ProgressPercentage; } }
void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { this.textBlock1.Text = e.Result; }
![Page 13: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/13.jpg)
13
WCF ASMX Services
![Page 14: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/14.jpg)
14
Restful Web Services
Use WCF Restful Services On Premise As a Azure WebRole
Data On premise In Cloud
Retrieve Lightweight rest services XML JSON
![Page 15: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/15.jpg)
15
Using ODATA From WCF From SQL Azure From publishers – http://odata.org Odata Client Library for WP7
![Page 16: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/16.jpg)
16
You Decide Simple Test Case : Downloaded 8 data records
Each Record had just four fields Measured bytes to transfer:
Odata version from WCF Data Services 8.5k
ASMX SOAP + Dataset - 3k REST + XML - 1.2k REST + JSON – 639bytes
![Page 17: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/17.jpg)
17
The Extras Menu Add an xml file to
project
![Page 18: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/18.jpg)
18
The Extras Menu Name it Extras.xml
![Page 19: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/19.jpg)
19
The Extras Menu Add the following xml
![Page 20: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/20.jpg)
A Quick Lap around the Phone• Connecting to Rest Service• Using Json (Data Contract
Serializer)• Adding your app to the extras
menu
Demo
![Page 21: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/21.jpg)
Push Notifications
![Page 22: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/22.jpg)
Push Notification Service
Built-in support for efficient, battery-aware mobile push notifications
Managed APIs for notification-driven interaction with existing Web 2.0 sites
Windows Phone Your Web Service
Custom Web Service
Existing Web Services
Microsoft Services
Push client service
Microsoft.Phone.Notification Notification
Service
![Page 23: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/23.jpg)
PUSH NOTIFICATIONS: DATA FLOW
Push client
Push service
Your service
Tile
App
Toast
Send push data to URI
Send push data to
client
Send URI to server
Open push channelReturn URIData to App
Data to toast
Data to tile
Event
![Page 24: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/24.jpg)
Windows Phone Microsoft confidential.
Push Notification Service
Seattle, WA: Sunny and 85 degrees
![Page 25: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/25.jpg)
25
Shell Tile Scheduler
![Page 26: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/26.jpg)
26
Shell Tile Scheduler
![Page 27: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/27.jpg)
A Quick Lap around the Phone• Push Notification Helper• ScheduleTileService
Demo
![Page 28: Windows Phone 7 Unleashed Session 2](https://reader035.vdocuments.site/reader035/viewer/2022062513/55526d02b4c9052e1f8b50f1/html5/thumbnails/28.jpg)
© 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.