simple for you while still delighting your users

41
www.buildwindows.com Creating connected apps that work on today's networks Peter Smith Program Manager Microsoft Corporation PLAT-785T

Upload: mabel-black

Post on 01-Jan-2016

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Simple for you while still delighting your users

www.buildwindows.com

Creating connected apps that work on today's networks

Peter Smith Program Manager Microsoft Corporation

PLAT-785T

Page 2: Simple for you while still delighting your users

www.buildwindows.com

Agenda

How to create a great connected app• Simple for you while still delighting your users• Eliminate “bill shock” surprise factor for users• Ease deployment hassles & boost user confidence

You’ll leave with• Examples and code snippets that you can use when

building your apps• Tips and techniques to make it easier to build great

connected apps

Page 3: Simple for you while still delighting your users

www.buildwindows.com

Photo viewer

demo

Page 4: Simple for you while still delighting your users

Simple for you while still delighting your users

Page 5: Simple for you while still delighting your users

www.buildwindows.com

We all want to make rich, connected apps without a lot of coding.

Page 6: Simple for you while still delighting your users

www.buildwindows.com

The Windows 8 Metro style app platform is designed just for that.

Page 7: Simple for you while still delighting your users

www.buildwindows.com

FundamentalsAuthenticat

ionCryptograp

hyGlobalizati

on.NET Win32App

Lifetime

Communications & Data

Contracts XML Web

NetworkingNotification

s

Local & Cloud StorageMedia

Capture

PlayTo

Devices

Sensors

Geolocation Portable

Devices

NFC

User InterfaceHTML5 /

CSSXAML DirectX Controls

Input Accessibility Printing

Data Binding

Tiles

Streams

Background Transfer

SVG

AtomPub

SMS

Printer

Visual Effects

Transcoding

APIs make it simple to build Metro style apps

Page 8: Simple for you while still delighting your users

www.buildwindows.com

HTTP APIs

Socket APIs

Background APIs

Data APIs

Json XML Streams

DataReader/DataWriter

Cost

Information APIsDownlo

ad

Web services

Skydrive

TCP sockets

UDP sockets

SSL socketsWeb

Sockets

AtomPubRSS

Network Information

Proximity sockets

Live ID

Upload

APIs make it simple to build Metro style apps

Xbox Live Azure

HttpWebRequest

HttpClient

XHR

IXHR

WCFAtom

RTCPush

NotificationCost

Page 9: Simple for you while still delighting your users

www.buildwindows.com

HTTP APIs

Socket APIs

Background APIs

Data APIs

Json XML Streams

DataReader/DataWriter

Cost

Information APIsDownlo

ad

Web services

Skydrive

TCP sockets

UDP sockets

SSL socketsWeb

Sockets

AtomPubRSS

Network Information

Proximity sockets

Live ID

Upload

APIs make it simple to build Metro style apps

Xbox Live Azure

Web Services

HttpClient

XHR

IXHR

WCFAtom

RTCPush

NotificationCost

Talk #581

Talk #580

#581

Talk #580

#270

#134

#756

#798, …

#410

#373, 807

#396

#784

Page 10: Simple for you while still delighting your users

HTTP APIs: Syndicating a News Feed

var syndicationClient = new Windows.Web.Syndication.SyndicationClient();

syndicationClient.retrieveFeedsAsync(uri).then(function (feed) { this.title = feed.title.text; this.image = feed.imageUri; this.summary = feed.subtitle.text; this.lastUpdatedTime = feed.lastUpdatedTime;});

Page 11: Simple for you while still delighting your users

Information APIs: Network ChangeWindows.Networking.Connectivity.NetworkInformation .addEventListener("networkstatuschanged", onNetworkChange);

function onNetworkChange(event) { if (event.type == "networkstatuschanged") { // It is a good time to reconnect. }}

Page 12: Simple for you while still delighting your users

var uri = new Windows.Foundation.Uri ("http://example.com/data.iso");var folder = Windows.Storage.KnownFolders.documentsLibrary;folder.createFileAsync("download.iso").then(function (file) { var downloader = new Windows.Networking .BackgroundTransfer.BackgroundDownloader(); downloader.startDownloadAsync(uri, file). then(function () { // Got the file with name 'file'. }, onError, onProgress);}, onError);

Background APIs: BackgroundTransfer

Page 13: Simple for you while still delighting your users

Sockets APIs: WebSocketsfunction quickLaunch() {

socket = new Windows.Networking.Sockets.StreamWebSocket();

socket.connectAsync(uri).then(function () {

writer = new Windows.Storage.Streams.DataWriter

(socket.outputStream);

writer.writeString("f");

writer.storeAsync().then(

function () { socket.close(); socket = null; }, onError);

}, onError);

}

Page 14: Simple for you while still delighting your users

Data APIs: using DataWriter

var writer =

new Windows.Storage.Streams.DataWriter (socket.outputStream);

var myString = "Hello";

writer.writeInt32(writer.measureString(myString));

writer.writeString(myString);

Page 15: Simple for you while still delighting your users

www.buildwindows.com

People want to take your app everywhere.

Page 16: Simple for you while still delighting your users

www.buildwindows.com

Work smoothly across networks

Try to Connect

Wait for Change Notification

(with timer+back off)

Use the connection

Still Workin

g?

Worked?

YES

NO NO

YES

Page 17: Simple for you while still delighting your users

www.buildwindows.com

Network change awareness in Photo Viewer

demo

Page 18: Simple for you while still delighting your users

Eliminate the “bill shock” surprise factor

Page 19: Simple for you while still delighting your users

www.buildwindows.com

Users take their apps everywhere!

Page 20: Simple for you while still delighting your users

www.buildwindows.com

Let’s end “bill shock” for users

Mythbuster Adam Savage fights $11,000 bill with Twitter army

Teen runs up dad’s cell bill to nearly $22,000

Customer Gets $62,000 Bill for Downloading Movie

Canadian man racks up $85,000 cell phone bill

FCC: 1 in 6 cell phone users have had ‘bill shock’

Page 21: Simple for you while still delighting your users

www.buildwindows.com

Windows 8 exposes network cost information – more visibility means

less surprises

Page 22: Simple for you while still delighting your users

Sample: getting cost information// Use NetworkInformation.getInternetConnectionProfile().// You can also get this on a per-socket basis.var cost = new Windows.Networking.Connectivity

.NetworkInformation.getInternetConnectionProfile()

.getConnectionCost();

 

cost.networkCostType; // One of: unrestricted, unknown, fixed, variable.

cost.approachingDataLimit;

cost.overDataLimit;cost.roaming;

Page 23: Simple for you while still delighting your users

www.buildwindows.com

Customize your app to network typeNormal

• Network state:• unrestricted• unknown

• Behavior: No restrictions on data transfer.

• Examples: stream HD, download hi-res pictures, retrieve mail attachments.

Conservative

• Network state:• fixed• variable

• Behavior: Transfer “less” data. Provide user override option.

• Examples: stream lower quality video, download low-res pictures, only retrieve mail headers.

Opt-In

• Network state:• roaming• overDataLimit

• Behavior: Transfer no data. Prompt user to override.

• Examples: no mail retrieved, video stops, can’t get weather info by default.

Page 24: Simple for you while still delighting your users

www.buildwindows.com

Cost awareness in Photo Viewer

demo

Page 25: Simple for you while still delighting your users

Deployment is easier

Page 26: Simple for you while still delighting your users

www.buildwindows.com

You want to install your app but have to handle firewalls.

Page 27: Simple for you while still delighting your users

www.buildwindows.com

Windows 8 Metro style apps will install with firewall rules – automatically!

Page 28: Simple for you while still delighting your users

www.buildwindows.com

Capabilities for the apps you want to build

• Social networking apps• Syndication Apps• Apps using web services like maps, weather

Internet (Client)

• Peer to Peer applications like Instant MessengerInternet

(Client & Server)

• Apps for sharing within the homeHome/work networking

• Connect app together between PCsNear-field proximity

Page 29: Simple for you while still delighting your users

www.buildwindows.com

People want to try new apps.

Page 30: Simple for you while still delighting your users

www.buildwindows.com

But people aren’t confident: what will this app do?

Page 31: Simple for you while still delighting your users

www.buildwindows.com

Capabilities solve this, too.

Page 32: Simple for you while still delighting your users

www.buildwindows.com

Recap: capabilities make deployment easier, and increase user confidence.

Page 33: Simple for you while still delighting your users

www.buildwindows.com

Network capabilities in Photo Viewer

demo

Page 34: Simple for you while still delighting your users

Recap

Page 35: Simple for you while still delighting your users

www.buildwindows.com

Great apps are connected.

Page 36: Simple for you while still delighting your users

www.buildwindows.com

Windows 8 provides a rich platform for enabling great connected experiences

Page 37: Simple for you while still delighting your users

www.buildwindows.com

Related sessions

HTTP APIs• PLAT-581T, Making apps social and connected with HTTP servicesWeb Services• PLAT-134C, The complete developer's guide to the SkyDrive API• PLAT-756T, Building Xbox LIVE games for Windows 8• APP-784T, Power your app with Live services• SAC-798T, Building Web APIs in Windows Azure with WCF to reach any deviceBackground APIs• APP-396T, Using tiles and notifications• APP-410T, Real time communication: keep your Metro style app connected whether it is

running or suspended• PLAT-581T, Making apps social and connected with HTTP servicesSocket APIs• PLAT-270T, Connecting and sharing with near field communication• PLAT-373C, Building real-time web apps with HTML5 WebSockets• PLAT-580T, Building Windows runtime sockets apps• SAC-807T, Building real-time web apps with WebSockets using IIS, ASP.NET and WCFOther Networking• TOOL-588T, Debugging connected Windows 8 apps

Page 38: Simple for you while still delighting your users

www.buildwindows.com

For more information

Documentation & articles• Networking• Managing network communications with sockets

Contact• Please visit the forums on the Windows Dev Center at

http://forums.dev.windos.com

Page 39: Simple for you while still delighting your users

www.buildwindows.com

• Feedback and questions http://forums.dev.windows.com

• Session feedbackhttp://bldw.in/SessionFeedback

thank you

Page 40: Simple for you while still delighting your users

© 2011 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.

Page 41: Simple for you while still delighting your users