Session III – Lifecycle and More
Daryl Rudolph
Agenda
Application
Lifecycle
Live
Tiles, Background
Process and
Lock Screen
Implementing the
Search Contract
Application Lifecycle
Show the flow
Feel Connected and
Alive
Memory Management
User selects app for foreground
System manages app lifetime
User launches many apps
User manages app lifetime
App process lifetime
Application States
Running
SuspendedNot Running
Resuming
Activated Suspending
Process lifetime walkthrough
When do apps get terminated
• System needs more memory
• User switch occurs
• System shutdown
• Apps crash
Apps do not get notified when
they are getting terminated
Process state transitions
5seconds
not
User
Launche
s App
Splash
screen
Suspend under the hood
• Suspended apps are not scheduled by the NT Kernel
• No CPU, Disk or Network consumed
• All threads are suspended
• Apps remain in memory
• Kernel ensures apps are not suspended in critical
sections that could cause system wide deadlocks
• Apps instantly resumed from suspend when brought to
foreground
Interacting with your users
App Activation Through Contracts
• Apps are activated through contracts
• Launch, search, ShareTarget, etc.
• Apps need to initialize contract specific actions
• Context is provided
Running App
launch
shareTarget
activated
kind
search
App crash? Start over
• Apps that are stuck are no fun
• Your app can be terminated abruptly in any of these
cases
• Too long to load
• Too long to suspend
• Stopped handling input messages (Blocking I/O on UI thread)
• Task manager
• Bring the user back home, and ignore saved user
session state
• previousExecutionState is provided in activation event
args
Best practices for saving and restoring state
Scenario You should….
User is using your
App
• Save user data incrementally
App switched away
from (Suspending)
• Save where the user is – what
screen they are on, for example
Not running App
launched by user
(Activated)
• Bring the user back and restore
their session as if they never left
Suspended App
launched by user
(Resuming)
• Do nothing
Demo
Suspend Demo
Search Contract
Finding your application
Use the Right
Contracts
Search 1 2 3
1. Search box is scoped to the
main app on screen
2. Query suggestions provided by
the main app on screen
• Autocompletes to terms for which
the app has search results
3. List of installed Windows 8 style
apps that have implemented the
search contract
Query submitted
User
Show Search
results view
Show previous
search results
view
Search Pane
Submit query to
App
Search App
Query Submitted
Event
Demo
Search Contract Demo
Live tiles
Keep the action going
Invest in a Great Tile
Windows 8 DevUnleashed - Session 3
Windows 8 DevUnleashed - Session 3
Badges
• Overlays status on top of tile
• Supports square and wide tiles
• Number up to 99 or pre-defined glyph:
• Always legible on top of images
BadgeBadge
Notification Queuing
• By default only last notification shown
• Opt-in to automatically cycle tile through last five
notifications
Live Tiles things to remember
• Tiles updated using pre-defined templates
• Text-only, image-only or combination
• JPEG or PNG only, max size 150 KB
• Local, cloud or background updates
Invest in a Great Tile
Demo
Live Tiles
Secondary Tiles
• Tiles created by “pinning” content from
app
• Pin initiated by app via simple runtime
call
• User confirms pin operation via system UI
• Exposes a personalized surface for app
• Same capabilities as app tiles
• Launch leads to relevant content
Demo
Secondary Tiles
RTC – Real Time Communication apps
Keep the action going
Invest in a Great Tile
Review app process lifetime
…with RTC appsThe app lifecycle
Network Trigger
RTC trigger APIs
System Trigger Time Trigger
Background Task Infrastructure
VoIP IM Your App
App OS
Network
Trigger
System
Trigger
Time
Trigger
Background Task Infrastructure
VoIP IM Mail
Changing Live Tile
Time
Trigger
Setting up a Time Trigger
Live tiles with push notifications
• Tiles can be updated even if
your app is not running!
• Push notifications can be used
to remotely update a tile on
the Start screen
• Great for showing the newest
content available to your users
App Cloud Service
Windows Push
Notification Service
(WNS)
HTTP POST
Notification
Delivered
Push Notification Overview
Notificatio
n
Client
Platform
App Service
Windows Push
Notification
Service
POST <channel URI> HTTP/1.1
Content-Type: text/xml
Host: db3.notify.windows.com
X-WNS-Type: wns/badge
Authorization: Bearer <authentication
token>
Content-Length: 58
<?xml version="1.0" encoding="utf-8"?>
<badge value="11"/>
Time
Trigger
using Windows.ApplicationModel.Background;
// Specify the trigger
TimeTrigger trigger = new TimeTrigger(UpdateInterval, Periodic);
Create time
trigger
// Associate app code with the trigger
BackgroundTaskBuilder taskBuilder = new BackgroundTaskBuilder();
taskBuilder.TaskEntryPoint = “MyApp.Background.UpdateEmailTask";
taskBuilder.SetTrigger(trigger);
taskBuilder.Name = “TimerExpiry";
Associate
trigger with
app code
// Register the task for background execution
IBackgroundTaskRegistration taskRegistration =
taskBuilder.Register();
Register
trigger
public sealed class UpdateLiveTileTask : IBackgroundTask {
public void Run(IBackgroundTaskInstance
taskInstance)
{
// Your app code to update email
}
}
}
using Windows.ApplicationModel.Background;
Time
Trigger
Demo
Live Tiles /Lock
Screen/Background
Best Practices for Tiles
• Display new, tailored and engaging content to the user
• Keep tile fresh by updating as your app content
changes
• Reference content that lives on your app’s
home page so the user can find it easily.
• Keep content safely ignorable and glanceable - for short
messages only
• Use square size if tile is not live
• No display ads! 
Agenda
Application
Lifecycle
Live Tiles,
Background
Process and
Lock Screen
Implementing the
Search Contract
Hands-On Lab 3 OR Create your own app
Running in the background
Create your own app
• You can work on Hands-on Lab 3 OR Create your own
app
• You have until 4:20 PM
• Don’t have to decide if you are entering until 4:20 PM
• Presentation can be PowerPoint and/or demonstration
• Must let me know beforehand if you don’t have VGA
connection
• Each contestant will have exactly 3 minutes to present!
• Be creative. Keep in mind the traits of a great Windows
8 app!
• Note: Anyone who attended today can enter to win the
app contest sponsored by Component Art for a $10,000
grand prize, even if you don’t enter today’s contest.
Contact/References
• Magenic – http://www.magenic.com
• Daryl Rudolph – darylr@magenic.com
• http://dev.windows.com
• http://design.windows.com
• API Sites
• http://www.restfulwebservices.net
• http://developer.mashery.com/apis
• http://www.programmableweb.com

More Related Content

PPTX
Service Configuration Management for Rapid Growth
PDF
Windows phone 8 session 10
PPTX
WordPress and IoT
PDF
Troubleshooting EC2- Linux Server Configuration
PPTX
uberSVN introduction by WANdisco
PPTX
Introduction to "TestProject" tool and first testcase with TestProject
PPT
Pro watch max pro class ppt5
PDF
POST/CON 2019 Workshop: Experts
Service Configuration Management for Rapid Growth
Windows phone 8 session 10
WordPress and IoT
Troubleshooting EC2- Linux Server Configuration
uberSVN introduction by WANdisco
Introduction to "TestProject" tool and first testcase with TestProject
Pro watch max pro class ppt5
POST/CON 2019 Workshop: Experts

Viewers also liked (7)

PPTX
Windows 8 DevUnleashed - Session 2
PPTX
Windows 8 DevUnleashed - Session 1
PDF
Utilisation des capteurs dans les applications windows 8
PDF
Humix Introduction 0528
PPTX
NFC & The Growth of Connected Consumer Electronics Devices
PPTX
Window architecture
Windows 8 DevUnleashed - Session 2
Windows 8 DevUnleashed - Session 1
Utilisation des capteurs dans les applications windows 8
Humix Introduction 0528
NFC & The Growth of Connected Consumer Electronics Devices
Window architecture
Ad

Similar to Windows 8 DevUnleashed - Session 3 (20)

PPTX
Windows 8 BootCamp
PPTX
Developing on Windows 8
PPTX
11 background tasks and multitasking
PPTX
A look behind the scenes: Windows 8 background processing
PPTX
WP8.1 Tiles and Notifications
PDF
Bcsf13a019_mcqs_ead
PDF
follow-app BOOTCAMP 2 - Windows Phone: Tiles and Notifications
PPTX
Live Tiles and Notifications in Windows Phone
KEY
Alive with activity
PPTX
A Day in the Life of a Metro-veloper
PPTX
Windows Phone 7.5 Mango - What's New
PPTX
Windows Phone Application Platform
PPTX
Windows Phone 7 Architecture Overview
PPTX
An end-to-end experience of Windows Phone 7 development (Part 1)
PPTX
Developing Apps for Windows Phone 8
PPTX
Whats new windows phone 8 1
PDF
07.Notifications & Reminder, Contact
PPTX
Cool Stuff Your App Can Do
PDF
Windows phone 8 session 11
PPTX
Windows Phone 8 - 8 Tiles and Lock Screen Notifications
Windows 8 BootCamp
Developing on Windows 8
11 background tasks and multitasking
A look behind the scenes: Windows 8 background processing
WP8.1 Tiles and Notifications
Bcsf13a019_mcqs_ead
follow-app BOOTCAMP 2 - Windows Phone: Tiles and Notifications
Live Tiles and Notifications in Windows Phone
Alive with activity
A Day in the Life of a Metro-veloper
Windows Phone 7.5 Mango - What's New
Windows Phone Application Platform
Windows Phone 7 Architecture Overview
An end-to-end experience of Windows Phone 7 development (Part 1)
Developing Apps for Windows Phone 8
Whats new windows phone 8 1
07.Notifications & Reminder, Contact
Cool Stuff Your App Can Do
Windows phone 8 session 11
Windows Phone 8 - 8 Tiles and Lock Screen Notifications
Ad

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Hybrid model detection and classification of lung cancer
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PPTX
Benefits of Physical activity for teenagers.pptx
PDF
A novel scalable deep ensemble learning framework for big data classification...
PPTX
observCloud-Native Containerability and monitoring.pptx
DOCX
search engine optimization ppt fir known well about this
PDF
Getting Started with Data Integration: FME Form 101
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PPTX
O2C Customer Invoices to Receipt V15A.pptx
NewMind AI Weekly Chronicles – August ’25 Week III
A comparative study of natural language inference in Swahili using monolingua...
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
Enhancing emotion recognition model for a student engagement use case through...
Hybrid model detection and classification of lung cancer
WOOl fibre morphology and structure.pdf for textiles
1 - Historical Antecedents, Social Consideration.pdf
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
DP Operators-handbook-extract for the Mautical Institute
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
sustainability-14-14877-v2.pddhzftheheeeee
Benefits of Physical activity for teenagers.pptx
A novel scalable deep ensemble learning framework for big data classification...
observCloud-Native Containerability and monitoring.pptx
search engine optimization ppt fir known well about this
Getting Started with Data Integration: FME Form 101
Taming the Chaos: How to Turn Unstructured Data into Decisions
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
O2C Customer Invoices to Receipt V15A.pptx

Windows 8 DevUnleashed - Session 3

  • 1. Session III – Lifecycle and More Daryl Rudolph
  • 3. Application Lifecycle Show the flow Feel Connected and Alive
  • 4. Memory Management User selects app for foreground System manages app lifetime User launches many apps User manages app lifetime
  • 8. When do apps get terminated • System needs more memory • User switch occurs • System shutdown • Apps crash Apps do not get notified when they are getting terminated
  • 10. Suspend under the hood • Suspended apps are not scheduled by the NT Kernel • No CPU, Disk or Network consumed • All threads are suspended • Apps remain in memory • Kernel ensures apps are not suspended in critical sections that could cause system wide deadlocks • Apps instantly resumed from suspend when brought to foreground
  • 12. App Activation Through Contracts • Apps are activated through contracts • Launch, search, ShareTarget, etc. • Apps need to initialize contract specific actions • Context is provided Running App launch shareTarget activated kind search
  • 13. App crash? Start over • Apps that are stuck are no fun • Your app can be terminated abruptly in any of these cases • Too long to load • Too long to suspend • Stopped handling input messages (Blocking I/O on UI thread) • Task manager • Bring the user back home, and ignore saved user session state • previousExecutionState is provided in activation event args
  • 14. Best practices for saving and restoring state Scenario You should…. User is using your App • Save user data incrementally App switched away from (Suspending) • Save where the user is – what screen they are on, for example Not running App launched by user (Activated) • Bring the user back and restore their session as if they never left Suspended App launched by user (Resuming) • Do nothing
  • 16. Search Contract Finding your application Use the Right Contracts
  • 17. Search 1 2 3 1. Search box is scoped to the main app on screen 2. Query suggestions provided by the main app on screen • Autocompletes to terms for which the app has search results 3. List of installed Windows 8 style apps that have implemented the search contract
  • 18. Query submitted User Show Search results view Show previous search results view Search Pane Submit query to App Search App Query Submitted Event
  • 20. Live tiles Keep the action going Invest in a Great Tile
  • 23. Badges • Overlays status on top of tile • Supports square and wide tiles • Number up to 99 or pre-defined glyph: • Always legible on top of images BadgeBadge
  • 24. Notification Queuing • By default only last notification shown • Opt-in to automatically cycle tile through last five notifications
  • 25. Live Tiles things to remember • Tiles updated using pre-defined templates • Text-only, image-only or combination • JPEG or PNG only, max size 150 KB • Local, cloud or background updates Invest in a Great Tile
  • 27. Secondary Tiles • Tiles created by “pinning” content from app • Pin initiated by app via simple runtime call • User confirms pin operation via system UI • Exposes a personalized surface for app • Same capabilities as app tiles • Launch leads to relevant content
  • 29. RTC – Real Time Communication apps Keep the action going Invest in a Great Tile
  • 30. Review app process lifetime
  • 31. …with RTC appsThe app lifecycle
  • 32. Network Trigger RTC trigger APIs System Trigger Time Trigger Background Task Infrastructure VoIP IM Your App App OS
  • 33. Network Trigger System Trigger Time Trigger Background Task Infrastructure VoIP IM Mail Changing Live Tile Time Trigger Setting up a Time Trigger
  • 34. Live tiles with push notifications • Tiles can be updated even if your app is not running! • Push notifications can be used to remotely update a tile on the Start screen • Great for showing the newest content available to your users App Cloud Service Windows Push Notification Service (WNS) HTTP POST Notification Delivered
  • 35. Push Notification Overview Notificatio n Client Platform App Service Windows Push Notification Service POST <channel URI> HTTP/1.1 Content-Type: text/xml Host: db3.notify.windows.com X-WNS-Type: wns/badge Authorization: Bearer <authentication token> Content-Length: 58 <?xml version="1.0" encoding="utf-8"?> <badge value="11"/>
  • 36. Time Trigger using Windows.ApplicationModel.Background; // Specify the trigger TimeTrigger trigger = new TimeTrigger(UpdateInterval, Periodic); Create time trigger // Associate app code with the trigger BackgroundTaskBuilder taskBuilder = new BackgroundTaskBuilder(); taskBuilder.TaskEntryPoint = “MyApp.Background.UpdateEmailTask"; taskBuilder.SetTrigger(trigger); taskBuilder.Name = “TimerExpiry"; Associate trigger with app code // Register the task for background execution IBackgroundTaskRegistration taskRegistration = taskBuilder.Register(); Register trigger
  • 37. public sealed class UpdateLiveTileTask : IBackgroundTask { public void Run(IBackgroundTaskInstance taskInstance) { // Your app code to update email } } } using Windows.ApplicationModel.Background; Time Trigger
  • 39. Best Practices for Tiles • Display new, tailored and engaging content to the user • Keep tile fresh by updating as your app content changes • Reference content that lives on your app’s home page so the user can find it easily. • Keep content safely ignorable and glanceable - for short messages only • Use square size if tile is not live • No display ads! 
  • 41. Hands-On Lab 3 OR Create your own app Running in the background
  • 42. Create your own app • You can work on Hands-on Lab 3 OR Create your own app • You have until 4:20 PM • Don’t have to decide if you are entering until 4:20 PM • Presentation can be PowerPoint and/or demonstration • Must let me know beforehand if you don’t have VGA connection • Each contestant will have exactly 3 minutes to present! • Be creative. Keep in mind the traits of a great Windows 8 app! • Note: Anyone who attended today can enter to win the app contest sponsored by Component Art for a $10,000 grand prize, even if you don’t enter today’s contest.
  • 43. Contact/References • Magenic – http://www.magenic.com • Daryl Rudolph – darylr@magenic.com • http://dev.windows.com • http://design.windows.com • API Sites • http://www.restfulwebservices.net • http://developer.mashery.com/apis • http://www.programmableweb.com