12/2/2018 12:23 PM APP-410T Real time communication: keep your Metro style app connected whether it is running or suspended Raghu Gatta Principal Development.

Slides:



Advertisements
Similar presentations
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Advertisements

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Preface Demo A Quick Thank You How Did We Do It?
Windows 8 (1) (2) (3) Windows 8 (1) (2) (3)
Feature: Identity Management - Login © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Feature: Reprint Outstanding Transactions Report © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Purchase Requisitions - Requester © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Co- location Mass Market Managed Hosting ISV Hosting.
Multitenant Model Request/Response General Model.
Feature: Purchase Order Prepayments II © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Announcing Demo Announcing.
Feature: OLE Notes Migration Utility
Feature: Web Client Keyboard Shortcuts © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Session 1.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
 Rico Mariani Architect Microsoft Corporation.
Feature: Assign an Item to Multiple Sites © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Windows 8 (1) (2) (3) Windows 8 (1) (2) (3)
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Print Remaining Documents © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Connect with life Connect with life
NEXT: Overview – Sharing skills & code.
demo Receive Inventory Export Parse and Normalize.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Document Attachment –Replace OLE Notes © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Customer Combiner and Modifier © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
demo Instance AInstance B Read “7” Write “8”

customer.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo Demo.
Feature: Void Historical/Open Transaction Updates © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
projekt202 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
The CLR CoreCLRCoreCLR © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

demo User Signs Up Temporary Account is Created with Verification Link Sent User Clicks Link Account is Activated Login.Register(userName,
MIX 09 4/17/2018 4:41 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Wireless Communication and Networks
Возможности Excel 2010, о которых следует знать
Building great Metro style apps for mobile broadband devices
Title of Presentation 11/22/2018 3:34 PM
Deep dive on app data roaming
MIX 09 11/24/2018 9:18 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Baseline: How Are We Doing Now?
Office Mac /30/2018 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Title of Presentation 12/2/2018 3:48 PM
1/3/2019 1:21 PM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Create experiences that span devices
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
4/27/17, Bell #8 What amount of net pay has been earned this period?
Using tiles and notifications
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
PENSACOLA ENERGY WORK PLAN OCTOBER 10, 2016
Title of Presentation 5/12/ :53 PM
Шитманов Дархан Қаражанұлы Тарих пәнінің
Title of Presentation 5/24/2019 1:26 PM
5/24/2019 6:44 PM 1/8/18 Bell #10 In a world governed by the gods, is there any room for human will? Do human choices make a difference? EXPLAIN © 2007.
日本初公開!? Vista の新機能を実演 とっちゃん わんくま同盟 7/23/2019 9:09 AM
Title of Presentation 7/24/2019 8:53 PM
WCL425 App Compat for Nerds Chris Jackson.
5/6/19, Bell #6 12/11/2019 8:26 PM Explain the relationship between this picture and the events that took place in Chapter 7 in Animal Farm. © 2007 Microsoft.
Presentation transcript:

12/2/2018 12:23 PM APP-410T Real time communication: keep your Metro style app connected whether it is running or suspended Raghu Gatta Principal Development Lead Microsoft Corporation Kamal Srinivasan Program Manager Microsoft Corporation © 2010 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.

Agenda Real Time Communication (RTC) app requirements User in control of the RTC apps Building your RTC app in Windows 8 You’ll leave knowing how to Build communication apps that work 24x7

Customer promise in Windows 8 Longer battery life Always reachable apps

Review app process lifetime Running App Suspended App Terminated App Suspending Low Memory Resuming

RTC apps that need to be always reachable What about RTC apps? VoIP IM Mail RTC apps that need to be always reachable

Windows enables you to develop apps that are always reachable!

The app lifecycle …with RTC apps Background Task Executes Background Running App Suspended App Terminated App Suspending Low Memory Resuming

Running an app in the background 12/2/2018 12:23 PM demo Chat app (PingMe) Running an app in the background © 2010 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.

RTC trigger APIs for your apps OS VoIP IM Mail Network Trigger System Trigger Time Trigger Background Task Infrastructure

Building an always reachable IM app

Building an IM app on Windows 8 Network Trigger System Trigger Time Trigger Background Task Infrastructure VoIP IM Mail Network Trigger System Trigger Receive an IM when app is in the background Receive an IM after user logs in

Execution Pattern App registers for trigger OS waits Trigger fires Background task executes

Register for IM network trigger Open your socket using Windows.Networking.Sockets; StreamSocket sock = new StreamSocket(); // Connect the streamsocket … // Create a Notification Channel with Push capability NotificationChannel nc = new NotificationChannel( "channelOne", “MyApp.Background.KeepAliveTask", “MyApp.Background.PushNotifyTask", ServerKATimeInMins); Add Control Channel metadata // Associate the socket with the notification channel channelStatus = nc.UsingTransport(sock); Register your socket © 2010 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.

App execution upon receiving IM Network Trigger App execution upon receiving IM using Windows.ApplicationModel.Background; public sealed class PushNotifyTask : IBackgroundTask { public void Run(IBackgroundTaskInstance taskInstance) { // Handle Incoming message // Throwing a toast code } © 2010 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.

Keep Alive maintains your control channel Network Keep alive Interval Server Keep alive Interval

App execution on Keep Alive Network Trigger App execution on Keep Alive using Windows.ApplicationModel.Background; public sealed class KeepAliveTask : IBackgroundTask { public void Run(IBackgroundTaskInstance taskInstance) { // Send Keepalive message to remote server } }} © 2010 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.

Register on User Login using Windows.ApplicationModel.Background; System Trigger Register on User Login Create user login trigger using Windows.ApplicationModel.Background; // Specify the trigger IBackgroundTrigger trigger = new SystemTrigger(SystemTriggerType.SessionStart, false); Associate trigger with app code // Associate app code with the trigger BackgroundTaskBuilder taskBuilder = new BackgroundTaskBuilder(); taskBuilder.TaskEntryPoint = “MyApp.Background.RegisterForUserLogin"; taskBuilder.SetTrigger(trigger); taskBuilder.Name = “OnUserPresent"; Register trigger // Register the task for background execution IBackgroundTaskRegistration taskRegistration = taskBuilder.Register(); © 2010 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.

App execution on User Login System Trigger App execution on User Login using Windows.ApplicationModel.Background; public sealed class RegisterForUserLogin: IBackgroundTask { public void Run(IBackgroundTaskInstance taskInstance) { // Your app code to create notification channel } © 2010 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.

Receive an IM when in “Connected Standby” 12/2/2018 12:23 PM demo Chat app (PingMe) Receive an IM when in “Connected Standby” © 2010 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.

Always connected Mobile broadband (e.g. 3G, 4G, LTE, etc.) Network Connectivity

How does this work in connected standby?

Nothing special, one model to stay connected.

Building a POP mail client with periodic updates

Building a POP mail app on Windows 8 Network Trigger System Trigger Time Trigger Background Task Infrastructure VoIP IM Mail Time Trigger Periodic Mail Sync

Register for Periodic Mail Sync Time Trigger Register for Periodic Mail Sync Create time trigger using Windows.ApplicationModel.Background; // Specify the trigger TimeTrigger trigger = new TimeTrigger(UpdateInterval, Periodic); Associate trigger with app code // Associate app code with the trigger BackgroundTaskBuilder taskBuilder = new BackgroundTaskBuilder(); taskBuilder.TaskEntryPoint = “MyApp.Background.UpdateEmailTask"; taskBuilder.SetTrigger(trigger); taskBuilder.Name = “TimerExpiry"; Register trigger // Register the task for background execution IBackgroundTaskRegistration taskRegistration = taskBuilder.Register(); © 2010 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.

App execution upon timer expiry Time Trigger App execution upon timer expiry using Windows.ApplicationModel.Background; public sealed class UpdateEmailTask : IBackgroundTask { public void Run(IBackgroundTaskInstance taskInstance) { // Your app code to update email } © 2010 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.

Review

Key points Longer Battery Life Always Reachable Apps

Write your RTC app code using background tasks. Key points Write your RTC app code using background tasks. Your app will be always reachable in connected standby.

Related sessions [APP-409T] Fundamentals of Metro style apps: how and when your app will run [HW-456T] Understanding Connected Standby [HW-566T] Networking for connected standby [PLAT-785T] Creating connected apps that work on today's networks [APP-396T] Using tiles and notifications

Further reading and documentation Introduction to Background Tasks http://go.microsoft.com/fwlink/?LinkID=227329&clcid=0x409 Contact info – AskRtcDev@microsoft.com (optional)

thank you Feedback and questions http://forums.dev.windows.com Session feedback http://bldw.in/SessionFeedback

12/2/2018 12:23 PM © 2011 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. © 2011 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.

Backup

Lock Screen API sample void AddToLockScreen() {     IAsyncOperation<LockScreenState> operation = LockScreen.AddToLockScreenAsync();     operation.Completed = OnAddToLockScreenOperationCompleted;     operation.Start(); }   void OnAddToLockScreenOperationCompleted(IAsyncOperation<LockScreenState> operation) {     if (operation.Status == AsyncStatus.Completed)     {         LockScreenState result = operation.GetResults();         switch (result)         {             case LockScreenState.NotOnLockScreen:                 break;             case LockScreenState.OnLockScreen:             case LockScreenState.DefaultNotOnLockScreen:         }     }     else if (operation.Status == AsyncStatus.Error){ // Report error © 2010 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.

Registering for Network Change System Event Registering for Network Change using Windows.ApplicationModel.Background; // Specify the trigger IBackgroundTrigger trigger = new SystemTrigger(SystemTriggerType.NetworkStateChange, false); // Associate app code with the trigger BackgroundTaskBuilder taskBuilder = new BackgroundTaskBuilder(); taskBuilder.TaskEntryPoint = “MyAppBackground.NetworkStateChangeTask"; taskBuilder.SetTrigger(trigger); taskBuilder.Name = “OnNetworkStateChange"; // Register the task for background execution IBackgroundTaskRegistration taskRegistration = taskBuilder.Register(); © 2010 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.

App execution upon network change System Event App execution upon network change using Windows.ApplicationModel.Background; public sealed class NetworkStateChangeTask : IBackgroundTask { public void Run(IBackgroundTaskInstance taskInstance) { // Re-register Notification Channel } © 2010 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.