#win8aca : how and when metro style apps run

41

Upload: frederik-bruyne

Post on 28-Nov-2014

1.296 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: #win8aca : How and when metro style apps run
Page 2: #win8aca : How and when metro style apps run
Page 3: #win8aca : How and when metro style apps run
Page 4: #win8aca : How and when metro style apps run
Page 5: #win8aca : How and when metro style apps run
Page 6: #win8aca : How and when metro style apps run

Apps do not get notified when

they are getting terminated

Page 7: #win8aca : How and when metro style apps run

demo

Page 8: #win8aca : How and when metro style apps run

User

Launches

App

Splash

screen

Page 9: #win8aca : How and when metro style apps run

//Register for the Suspending event and call suspendingHandler when received Windows.UI.WebUI.WebUIApplication.addEventListener("suspending", suspendingHandler); //Handle the suspending event and save the current user session using WinJS sessionState function suspendingHandler(eventArgs) { //We are getting suspended } //Register for the Resuming event and call resumingHandler when received Windows.UI.WebUI.WebUIApplication.addEventListener("resuming", resumingHandler); function resumingHandler() { //We are getting resumed, in general do nothing }

Page 10: #win8aca : How and when metro style apps run
Page 11: #win8aca : How and when metro style apps run

demo

Page 12: #win8aca : How and when metro style apps run
Page 13: #win8aca : How and when metro style apps run
Page 14: #win8aca : How and when metro style apps run

Scenario You should….

Page 15: #win8aca : How and when metro style apps run

demo

Page 16: #win8aca : How and when metro style apps run
Page 17: #win8aca : How and when metro style apps run
Page 18: #win8aca : How and when metro style apps run
Page 19: #win8aca : How and when metro style apps run
Page 20: #win8aca : How and when metro style apps run

demo

Page 21: #win8aca : How and when metro style apps run
Page 22: #win8aca : How and when metro style apps run
Page 23: #win8aca : How and when metro style apps run

Running app

Tile launch activation

User taps on Tile launch

eventArgs.kind Splash Screen shown

activated event

Page 24: #win8aca : How and when metro style apps run
Page 25: #win8aca : How and when metro style apps run
Page 26: #win8aca : How and when metro style apps run
Page 27: #win8aca : How and when metro style apps run

HTTP POST

Notification Delivered

Page 28: #win8aca : How and when metro style apps run
Page 29: #win8aca : How and when metro style apps run
Page 30: #win8aca : How and when metro style apps run
Page 31: #win8aca : How and when metro style apps run
Page 32: #win8aca : How and when metro style apps run
Page 33: #win8aca : How and when metro style apps run
Page 34: #win8aca : How and when metro style apps run

Trigger Condition

InternetAvailable,

InternetNotAvailable,

SessionConnected,

SessionDisconnected,

UserNotPresent,

UserPresent

TimeTrigger*

PushNotificationTrigger*

SessionStart*

ControlChannelTrigger*(**)

ServicingComplete

SessionConnected

SessionDisconnected

SmsReceived

TimeZoneChange

UserAway/UserPresent,

LockScreenApplicationAdded/Removed

OnlineIdConnectedStateChangeInternetAvailable

InternetAvailable/InternetNotAvailable

NetworkNotificationChannelReset

NetworkStateChange

MaintenanceTrigger

PushNotificationTrigger**

*requires lock permission

**can run in App (not BackgroundHost.exe)

Page 35: #win8aca : How and when metro style apps run

function RegisterSampleBackgroundTaskWithCondition()

{

var builder = new Windows.ApplicationModel.Background.BackgroundTaskBuilder();

builder.name = "BackgroundTestWorker";

builder.taskEntryPoint = "BackgroundTestWorker.js";

// run a timetrigger for every 15 minutes

var myTrigger = new Windows.ApplicationModel.Background.TimeTrigger(15, true);

builder.setTrigger(myTrigger);

// required condition: internetAvailable

var condition = new

Windows.ApplicationModel.Background.SystemCondition(Windows.ApplicationModel.Background.Sys

temConditionType.internetAvailable);

builder.addCondition(condition);

// register the task

var task = myTaskBuilder.register();

task.addEventListener("progress", task_Progress);

task.addEventListener("completed", task_Completed);

}

Page 36: #win8aca : How and when metro style apps run

<Application Id="App" StartPage="default.html"> <VisualElements DisplayName="SimpleBackgroundTask" Logo="images\logo.png" SmallLogo="images\smalllogo.png" Description="SimpleBackgroundTask" ForegroundText="light" BackgroundColor="#000000"> <LockScreen Notification="badge" BadgeLogo="badgelogo.png" /> <SplashScreen Image="images\splashscreen.png" /> </VisualElements> <Extensions> <Extension Category="windows.backgroundTasks" StartPage="backgroundTaskLogger.js"> <BackgroundTasks> <Task Type="timer" /> <Task Type="systemEvent" /> </BackgroundTasks> </Extension> </Extensions> </Application>

Page 37: #win8aca : How and when metro style apps run

demo

Page 38: #win8aca : How and when metro style apps run
Page 39: #win8aca : How and when metro style apps run

CPU resource quota Refresh period

Lock screen app

Non-lock screen app

Page 40: #win8aca : How and when metro style apps run
Page 41: #win8aca : How and when metro style apps run