• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
WinStore.vn - Training Windows 8 - How and When Windows Store Apps Run
 

WinStore.vn - Training Windows 8 - How and When Windows Store Apps Run

on

  • 711 views

http://winstore.vn

http://winstore.vn

Statistics

Views

Total Views
711
Views on SlideShare
711
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    WinStore.vn - Training Windows 8 - How and When Windows Store Apps Run WinStore.vn - Training Windows 8 - How and When Windows Store Apps Run Presentation Transcript

    • FOR WINDOWS 8 CAMP ATTENDEE USE ONLYNOT FOR REDISTRIBUTIONhttp://aks.ms/windows8campinabox http://dev.windows.com http://devcamps.ms/windows win8tkfb@microsoft.com
    • demo
    • Apps do not get notified when they are getting terminated
    • //Register for the Suspending event and call suspendingHandler when receivedWindows.UI.WebUI.WebUIApplication.addEventListener("suspending", suspendingHandler);//Handle the suspending event and save the current user session using WinJS sessionStatefunction suspendingHandler(eventArgs) {//We are getting suspended}//Register for the Resuming event and call resumingHandler when receivedWindows.UI.WebUI.WebUIApplication.addEventListener("resuming", resumingHandler);function resumingHandler( ) {//We are getting resumed, in general do nothing}
    • demo
    • Scenario You should….
    • demo
    • UserLaunches App Splash screen
    • Windows.UI.WebUI.WebUIApplication.addEventListener("activated", activatedHandler);function activatedHandler(eventArgs) { /* aK.shareTarget || aK.cameraSettings || aK.contactPicker || aK.device || aK.file || aK.fileOpenPicker || .. */ // previous state:}
    • demo
    • Trigger ConditionSystemEventTrigger InternetAvailable, ControlChannelReset # InternetNotAvailable, InternetAvailable SessionConnected, LockScreenApplicationAdded/Removed SessionDisconnected, NetworkStateChange UserNotPresent, OnlineIdConnectedStateChange UserPresent ServicingComplete SessionConnected/Disconnected # SmsReceived TimeZoneChange UserAway/UserPresent #ControlChannelTrigger # (**)TimeTrigger #PushNotificationTrigger # (**)MaintenanceTrigger # requires lock permission **can run in App (not BackgroundTaskHost.exe)
    • 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, false); builder.setTrigger(myTrigger);// required condition: internetAvailable var condition = newWindows.ApplicationModel.Background.SystemCondition(Windows.ApplicationModel.Background.SystemConditionType.internetAvailable); builder.addCondition(condition);// register the task var task = builder.register(); task.addEventListener("progress", task_Progress); task.addEventListener("completed", task_Completed);}
    • <Extensions> <Extension Category="windows.backgroundTasks" StartPage="jsbackgroundtask.js"> <BackgroundTasks> <Task Type="systemEvent" /> </BackgroundTasks> </Extension></Extensions>
    • demo
    • CPU resource quota Refresh period Lock screen appNon-lock screen app