38
Evaluations http://europe.msteched.com/sessi ons Submit your evals online

Evaluations Submit your evals online

Embed Size (px)

Citation preview

Evaluations

http://europe.msteched.com/sessions

Submit your evals online

Live Tiles and Push Notifications

Ben RigaTechnical Evangelist, Windows PhoneMicrosoft Corporation

Ben Riga

[email protected]://bit.ly/TopRankedtwitter: @benriga

Windows Phone

Follow me on Twitter

or the Puppy gets it@benriga

Topics

End-User ExperienceTile 101Multiple Live TilesWhat about Windows Phone 8Updating a Live Tile from a background processPush Notifications

Consumer Experience

Windows phone has the unique ability to provide the end user glanceable access to the information they care most about, via Live Tiles

Push Notifications offer developers a way to send timely information to the end user’s device even when the application is not running, including Tile updates

Tiles 101

Shortcuts to apps Static or dynamic2 sizes: small & large

Large only for 1st party apps

End-user is in control

Data Driven Template Model

A fixed set of data propertiesEach property corresponds to a UI elementEach UI element has a fixed position on screenNot all elements need to be usedAnimations are not extensible

Background Image

(173 x 173 .png)

Title Count

Scenarios/Popular Applications

Weather AppsWeather TileWarning Toast

Chess by PostTurn TileMove Toast

BeezzUnread TileDirect Toast

Send to WP7Link TileLink Toast

AlphaJaxTurn TileMove Toast

Seattle Traffic MapTraffic Tile

There are hundreds and hundreds of Push apps in Marketplace!

Primary and Secondary Tiles

Application TilePinned from App ListProperties are set initially in the Application Manifest

Secondary TileNew in Windows Phone 7.5!Created as a result of user input in an application

Front

Back

Live Tiles – Local Tile API

Local tile updates (these are *not* push)

Full control of all properties when your app is in the foreground or backgroundCalorie counter, sticky notes

Multi-Tile!Deep-link to specific application sectionsLaunch directly to page/experience

Application TileLaunches main app experience

Secondary TileLaunches world news page

Secondary TileLaunches local news page

Live Tiles – Local Tile API Continued…

Back of tile updatesFull control of all properties when your app is in the foreground or backgroundContent, Title, Background

Flips from front to back at random intervalSmart logic to make flips asynchronous

Title

Content

Title

BackgroundContent string is bigger

Click to add pictureWhat about Windows Phone 8?

Windows Phone 8 - TilesSmall – small image, count (shared)

Medium – front/back medium image, count (shared), front/back title (shared), back content (distinct)*identical to Mango

Wide – optional, front/back wide image, count (shared), front/back title (shared), back content (distinct)

8

8

8

Tiles Back Compat Story

Mango apps will get the small tile size for free in Windows Phone 8!

Absolutely zero work required - the default tile assets will be used for the small size for all app tiles (primary and secondary)

Demo

Live Tiles – Local Tile API

Tile Schedule

Periodically updates the tile image without pushing message though Updates images only from the web, not from the app local storeSets up notification channel and binds it to a tile notificationFew limitations

Image size must be less than 80 KBDownload time must not exceed 60 secondsLowest update time resolution is 60 minutesIf the schedule for an indefinite or finite number of updates fails too many times, OS will cancel it

Update recurrence can by Onetime, EveryHour, EveryDay, EveryWeek or EveryMonth

Scheduling Tile Updatepublic partial class MainPage : PhoneApplicationPage {    private ShellTileSchedule _mySchedule;    public MainPage()   {        InitializeComponent();        ScheduleTile();    }

     private void ScheduleTile()    {        _mySchedule = new ShellTileSchedule();        _mySchedule.Recurrence = UpdateRecurrence.Onetime;        _mySchedule.StartTime = DateTime.Now;        _mySchedule.RemoteImageUri = new

Uri("http://cdn3.afterdawn.fi/news/small/windows-phone-7-series.png");        _mySchedule.Start();    }}

Updating Tiles from a Background Agent

In Windows Phone OS 7.0, only way of updating Live Tiles was from a Tile Schedule or from Notifications

Tile Schedule needs to fetch images from a web URINotifications require you to implement a backend service

To have control of shell tiles when the app is not running without using Push Notifications, a good solution is a Background Agent

Use the ShellTile API to locate and update tiles

Don’t take a dependency on thisUser or system could halt your background process

Remember that Background Agents expire after 2 weeksLet the User know

Demo

Updating Tiles from a Background Agent

Push Notifications

Server-initiated communicationEnable key background scenariosPreserve battery life and user experiencePrevent polling for updates

Windows Phone

Push Notification Data Flow - Setup

URI to the service:"http://notify.live.com/throttledthirdparty/01.00/

AAFRQHgiiMWNTYrRDXAHQtz-AgrNpzcDAwAAAAQOMDAwMDAwMDAwMDAwMDA"

Push enabled applications

NotificationService

Push endpoint is established. URI is created for the endpoint.

1

2

3rd party service

Microsofthosted server

Windows Phone

Push Notification Data Flow - Notification

Push enabled applications

NotificationService

HTTP POST the message

3Send PN Message

4

3rd party service

Microsofthosted server

Three Kinds of Notifications

RawNotification message content is application-specificDelivered directly to app only if it is running

ToastSpecific XML schemaContent delivered to app if it is runningIf app is not running, system displays Toast popup using notification message content

TileSpecific XML schemaNever delivered to app If user has pinned app tile to Start screen, system updates it using notification message content

Toast Notification

App icon and two text fieldsTime critical and personally relevantUsers must opt-in via app UI

Demo

Push Notifications

Windows Phone

Response Custom Headers

• Response Code: HTTP status code (200 OK)

• Notification Status– Notification received by the Push Notification Service– For example: “X-NotificationStatus:Received”

• DeviceConnectionStatus– The connection status of the device– //For example: X-DeviceConnectionStatus:Connected

• SubscriptionStatus– The subscription status– //For example: X-SubscriptionStatus:Active

• More information – http://msdn.microsoft.com/en-us/library/ff402545(v=VS.92).aspx

Security Technical Details

Two levels of trustAuthentication:Phone Client – MS server :

TLS + WL Device ID

MS Server – 3rd party service:HTTPs (for third-party)

Throttling for unauthenticated services Authorization:

Token (notification URI) validated with each PUSH notification

Summary

In this session we covered how tiles work, live tiles, shell tiles as well as how to support multiple tiles from a single application.We also covered updating a Live Tile from a Background Application as well as via Push Notifications

Windows Phone

Follow me on Twitter

or the Puppy gets it@benriga

Ben Riga

[email protected]://bit.ly/TopRankedtwitter: @benriga

Windows Phone

Windows Phone Sessions

Tuesday12:00

G105

WPH201 What's New

14:45

G105

WPH203 Build Apps and Games for WP 7.5

16:30

E107 WPH202 Collaborate Through Exchange, SharePoint, Lync and Office 365

Wednesday12:00

E104 WPH204 Application UI Design Principles

14:45

D201

WPH304 Security Deep Dive

17:00

G105

WPH206 How to Make Money with your Applications and Games

Thursday08:30 G10

5WPH205 Device and App Management

12:00 G105

WPH301 Tiles and Notifications

14:45 G105

WPH207 Building Enterprise Apps

16:30 D201

WPH302 Localization and Globalization

Friday08:30

G105 WPH303 Windows Phone: Optimizing Application Performance

10:15

G105 WPH208 Windows Phone: MVVM and Unit Testing Step by Step

Windows Phone

Resources

Connect. Share. Discuss.

http://europe.msteched.com

Learning

Microsoft Certification & Training Resources

www.microsoft.com/learning

TechNet

Resources for IT Professionals

http://microsoft.com/technet Resources for Developers

http://microsoft.com/msdn

Evaluations

http://europe.msteched.com/sessions

Submit your evals online

Nokia Lumia 900 Prize

Question: Name 4 ways to update a Live Tile on Windows Phone

Q&ABen RigaTechnical Evangelist, Windows PhoneMicrosoft Corporation

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