180 likes | 203 Views
Learn how to build connected applications using Windows Phone 8 networking support and explore the overlap between WP7, WP8, and Windows 8.
E N D
Windows Phone 8Networking: Building Connected Apps Tim Laverty timlav@microsoft.com @ @TimLaverty Program Manager Windows Phone
Great apps connect you to devices and people Windows Phone 8 makes it easy to build connected applications.
Goals • Show what’s possible for you to do using Windows Phone 8 networking support • Highlight overlap between WP7, WP8, and Windows 8
Windows Phone 7.1 System.Net .WebRequest HTTP .Sockets TCP/UDP, No Listening .WebClient HTTP Wrapper, Not Awaitable
Windows Phone 8 Windows.Networking System.Net .WebClient HTTP Wrapper, No Async .Proximity NFC, Bluetooth .WebRequest HTTP .Sockets TCP/UDP .WebClient HTTP Wrapper, Not Awaitable .Sockets TCP/UDP Native IXMLHTTPRequest2 (IXHWR) Winsock TCP/UDP
Sockets • WinRT – Windows.Networking.Sockets • TCP- StreamSocket • UDP- DatagramSocket • Managed Sockets – System.Net.Sockets • TCP & UDP- Socket, Multicast, Listen • Winsock - winsock2.h, ws2tcpip.h, …. • Winsock API Family; SOCK_STREAM, SOCK_DGRAM
DEMO: Socket Test AppWinsock, Managed Sockets, WinRT Sockets
Sockets Summary • WinRT Sockets • Recommended • Lean code that’s portable to Win8 • .NET sockets • Not portable to Win8 Store apps • Use if you have legacy code that already uses .NET sockets • Winsock • Not portable to Win8 Store apps • Use if you have legacy code that already uses Winsock
Proximity • Bluetooth • 0-100m range • WinRTStreamSocket for communication (~2.1 Mbit/s) • Allows App->App and App->Device connectivity • Near Field Communication (NFC) • Short range (2-4cm) protocol, low bandwidth (~424 kbit/s) • Acquire connections and exchange small amount of data, bootstrap WinRT StreamSocket • Allows App->App and App->Device connectivity
HTTP Support Platform Managed Native WP8 • HTTPWebRequest • WebClient • IXMLHTTPRequest2 Win8 • HTTPWebRequest • HTTPClient • IXMLHTTPRequest2
DEMO: Music Download & ShareNFC (App->Device, App->App), Tag Writing, HTTP
Review • Windows Phone 8 delivers a full featured networking story • Proximity API • NFC • Bluetooth • HTTP • WinRT Sockets • Support for legacy WinSock API
NETWORKING RESOURCES • Nokia NFCInteractor application • OSS NDEF plugin for VS2012 supporting WP8 and Win8: http://www.nfcinteractor.com/ • Andreas Jakl(@Mopius) PCL NDEF Reader: https://ndef.codeplex.com/ • Michelin Guide (Search the AppStore) • Sockets: Beej’snetworking guide: http://beej.us/guide/bgnet/
WP8 RESOURCES • Resource Listhttp://wpdev.ms/phonedevres • Certification Requirementshttp://wpdev.ms/certreq • “How To” Indexhttp://wpdev.ms/howtos • Official Sampleshttp://wpdev.ms/officialsamples • Forumshttp://wpdev.ms/ahforum • Supporthttp://wpdev.ms/devsupport
COMMUNITY • User Voicehttp://wpdev.uservoice.com • Twitter - #WPDEVhttps://twitter.com/#!/search/%23wpdev
Please fill your evaluations out! (I’m trying to get better)