httpeuropemstechedcomsessions Submit your evals online Live Tiles and Push Notifications Ben Riga Technical Evangelist Windows Phone Microsoft Corporation Ben Riga benrigamicrosoftcom ID: 423197
Download Presentation The PPT/PDF document "Evaluations" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Evaluations
http://europe.msteched.com/sessions
Submit your evals online Slide2Slide3
Live Tiles and
Push NotificationsBen Riga
Technical Evangelist, Windows PhoneMicrosoft CorporationSlide4
Ben Riga
benriga@microsoft.comhttp://bit.ly/TopRanked
twitter: @benrigaSlide5
Follow me on Twitter
or the Puppy gets it
@benrigaSlide6
Topics
End-User ExperienceTile 101
Multiple Live TilesWhat about Windows Phone 8Updating a Live Tile from a background process
Push NotificationsSlide7
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 updatesSlide8
Tiles 101
Shortcuts to apps Static or dynamic2 sizes: small & large
Large only for 1st party appsEnd-user is in controlSlide9
Data Driven Template Model
A fixed set of data propertiesEach property corresponds to a UI elementEach UI element has a fixed position on screen
Not all elements need to be usedAnimations are not extensible
Background Image
(173 x 173 .
png
)
Title
CountSlide10
Scenarios/Popular Applications
Weather Apps
Weather Tile
Warning ToastChess by PostTurn TileMove ToastBeezz
Unread Tile
Direct Toast
Send to WP7
Link Tile
Link Toast
AlphaJax
Turn Tile
Move Toast
Seattle Traffic Map
Traffic Tile
There are hundreds
and hundreds of
Push
apps in Marketplace!Slide11
Primary and Secondary Tiles
Application TilePinned from App List
Properties are set initially in the Application ManifestSecondary TileNew in Windows Phone 7.5!
Created as a result of user input in an application
Front
BackSlide12
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 notesMulti-Tile!
Deep-link to specific application sectionsLaunch directly to page/experienceApplication TileLaunches main app experience
Secondary Tile
Launches world news page
Secondary Tile
Launches local news pageSlide13
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
Background
Content string is biggerSlide14
What about Windows Phone 8?Slide15
Windows Phone 8 - Tiles
Small – 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
8Slide16
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)Slide17
Demo
Live Tiles – Local Tile APISlide18
Tile Schedule
Periodically updates the tile image without pushing message though Updates images only from the web, not from the app local store
Sets up notification channel and binds it to a tile notificationFew limitationsImage size must be less than 80 KB
Download 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 itUpdate recurrence can by Onetime, EveryHour, EveryDay, EveryWeek or EveryMonthSlide19
Scheduling Tile Update
public 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(); }}Slide20
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 serviceTo 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 tilesDon’t take a dependency on thisUser or system could halt your background processRemember that Background Agents expire after 2 weeksLet the User knowSlide21
Demo
Updating Tiles from a Background AgentSlide22
Push Notifications
Server-initiated communicationEnable key background scenariosPreserve battery life and user experiencePrevent polling for updatesSlide23
Push Notification Data
Flow - Setup
URI to the service:
"http://notify.live.com/throttledthirdparty/01.00/AAFRQHgiiMWNTYrRDXAHQtz-AgrNpzcDAwAAAAQOMDAwMDAwMDAwMDAwMDA"
Push enabled applications
Notification
Service
Push endpoint is established. URI is created for the endpoint.
1
2
3
rd
party
service
Microsoft
hosted
serverSlide24
Push Notification Data
Flow - Notification
Push enabled applications
Notification
Service
HTTP POST the message
3
Send PN Message
4
3
rd
party
service
Microsoft
hosted
serverSlide25
Three Kinds of Notifications
RawNotification message content is application-specific
Delivered directly to app only if it is runningToastSpecific XML schema
Content delivered to app if it is runningIf app is not running, system displays Toast popup using notification message contentTileSpecific XML schemaNever delivered to app If user has pinned app tile to Start screen, system updates it using notification message contentSlide26
Push Notifications – Features in WP 7.5
Multi-Tile/Back of Tile SupportMultiple weather locations, news categories, sports team scores, twitter favorites
Can update all tiles belonging to your applicationNo API Change for binding tilesBindToShellTile
now binds you to all tilesSend Tile ID to service and use new attribute to direct updateThree new elements for back of tile propertiesSlide27
Toast Notification
App icon and two text fields
Time critical and personally relevant
Users must opt-in via app UISlide28
Demo
Push NotificationsSlide29
Response Custom Headers
Response Code: HTTP status code (200 OK)Notification StatusNotification received by the Push Notification Service
For example: “X-NotificationStatus:Received”DeviceConnectionStatus
The connection status of the device//For example: X-DeviceConnectionStatus:ConnectedSubscriptionStatusThe subscription status//For example: X-SubscriptionStatus:ActiveMore information http://msdn.microsoft.com/en-us/library/ff402545(v=VS.92).aspx Slide30
Security Technical Details
Two levels of trustAuthentication:
Phone Client – MS server : TLS + WL Device IDMS Server – 3rd party service:HTTPs (for third-party)
Throttling for unauthenticated services Authorization: Token (notification URI) validated with each PUSH notificationSlide31
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 NotificationsSlide32
Follow me on Twitter
or the Puppy gets it
@benrigaSlide33
Ben Riga
benriga@microsoft.comhttp://bit.ly/TopRanked
twitter: @benrigaSlide34
Windows Phone Sessions
Tuesday
12: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
Wednesday
12: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
Thursday
08:30
G105
WPH205
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
Friday
08:30
G105
WPH303
Windows Phone: Optimizing Application Performance
10:15
G105
WPH208
Windows Phone: MVVM and Unit Testing Step by StepSlide35
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 Slide36
Evaluations
http://europe.msteched.com/sessions
Submit your evals online Slide37
Nokia Lumia 900 Prize
Question:
Name 4 ways to update a
Live Tile on
Windows PhoneSlide38
Q&A
Ben RigaTechnical Evangelist, Windows PhoneMicrosoft CorporationSlide39
©
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.