11/19/2018 05 | App Model & Storage © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.

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.
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.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
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.
Platform for building Windows Store Apps Agu Suur Frontend Developer Axinom.
Multitenant Model Request/Response General Model.
Announcing Demo Announcing.
Feature: Web Client Keyboard Shortcuts © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Session 1.
travel Suru Windows 7 Release NET 4.0 / Surface 2.0 Release Multi-Touch Controls Multi-Touch API Surface Multi-Touch Controls & API Surface.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
 Rico Mariani Architect Microsoft Corporation.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Windows 8 (1) (2) (3) Windows 8 (1) (2) (3)
WinHEC /22/2017 © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Connect with life Connect with life
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Customer Combiner and Modifier © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Feature: Employee Self Service Timecard Entry © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
© 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.
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.

IoCompleteRequest (Irp);... p = NULL; …f(p);
DataModel VisualizationExternal Assets Workbook Excel Services API BrowserRich Apps EWA JSOMBrowser REST BrowserRich Apps.
Windows Developer Day Fall Creators Update Chris Cortes
WebView: Bringing the web to your app
Developing an app for SharePoint autohosted in Azure
What web developers need to know when building Metro style apps
Возможности Excel 2010, о которых следует знать
Microsoft Build /9/2018 8:05 PM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,
Building Apps for Windows Phone 8.1 Jump Start
Title of Presentation 11/22/2018 3:34 PM
Metro style apps using XAML: Make your app shine
Tooling and Diagnostics
TechEd /29/ :46 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
12/2/ :23 PM APP-410T Real time communication: keep your Metro style app connected whether it is running or suspended Raghu Gatta Principal Development.
Title of Presentation 12/2/2018 3:48 PM
Windows Runtime App Lifecycle
Platform for Metro style Apps
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/9/ | Contracts © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
Under the hood: Installation and updates for Metro style apps
PENSACOLA ENERGY WORK PLAN OCTOBER 10, 2016
5/1/2019 3:29 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Title of Presentation 5/12/ :53 PM
Шитманов Дархан Қаражанұлы Тарих пәнінің
The complete developer's guide to the SkyDrive API
Title of Presentation 5/24/2019 1:26 PM
日本初公開!? Vista の新機能を実演 とっちゃん わんくま同盟 7/23/2019 9:09 AM
Title of Presentation 7/24/2019 8:53 PM
03 | Async Programming & Networking Intro
What’s New in Visual Studio 2012 for Web Developers
Presentation transcript:

11/19/2018 05 | App Model & Storage © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.

Course Topics Building Windows Store Apps for iOS Developers Jump Start 01 | Introduction to the Windows Store Platform and the tools 02 | C# for Objective-C developers 03 | Async programming & Networking intro Meal Break, around noon PST 45 to 60 mins 04 | Introduction to XAML & UI Patterns for XAML apps 05 | App Model & Storage 06 | Contracts 07 | Notifications 08 | Windows Store APIs

Windows Store app acquisition Windows Store backend Package Manager Windows Store install Execution Engine Extension Handler stage Single instance store register Registration Information

Building blocks of an app package App Manifest contains all information needed to deploy the app Blockmap contains hashes of all files within the app package Signature validates the integrity of the app package AppXManifest.xml BlockMap Signature Zip Central Directory Files / Assets .appx package

Inside the App Bundle - iOS

Inside the App Package - Windows

App manifest and capabilities Explicitly declares the app integration endpoints File capabilities (music/pictures/videos/documents libraries, removable storage) Devices (webcam, microphone, location, sms, proximity); extensible to new device classes Network and identity (internet, private network, credentials) File type associations App contracts (search, share, etc.) Contained in appxmanifest.xml; Visual Studio provides editor

Process Isolation Process1 Process2 OS Contracts Direct APIs Brokers 11/19/2018 Process Isolation Process1 Local context Web context AppData Local Temp Roaming Process2 Local context Web context AppData Local Temp Roaming Contracts Direct APIs Brokers OS User data Devices Communications Handlers Tiles Cryptography … … © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.

demo Capabilities 11/19/2018 12:03 AM © 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 Lifecycle and States iOS Apps Windows Store Apps State Visible Receives Events Executes Code Not Running No Active Yes Inactive Mostly Background Suspended State Visible Receives Events App Executes Code NotRunning No Running Yes (No Necessary Equivalent) (Accomplished by Background Tasks) Suspended Terminated ClosedByUser

Windows Store App Lifecycle .appx package

Process State Transitions App gets 5s to handle suspend App is not notified before termination Running App suspending Suspended App Terminated App User Launches App Low Memory resuming Apps are notified when they have been resumed Splash screen Code gets to run No code runs App not running

Process State Transitions 11/19/2018 Process State Transitions App gets 5s to handle suspend App is not notified before termination Running App suspending Suspended App Terminated App User Launches App Low Resources resuming Apps are notified when they have been resumed Splash screen Code gets to run No code runs App not running © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.

Process State Transitions - Simulation App 1 App 2 App 3 … App N Running Apps suspend after a short delay Apps resume instantly from suspend Suspended App terminated under memory pressure without notification Terminated

Global State Management with SuspensionManager Saving MyGame.Common.SuspensionManager.SessionState["gameStatus"] = GameViewModel.CurrentGameStatus; Restoring GameViewModel.CurrentGameStatus = MyGame.Common.SuspensionManager.SessionState["gameStatus"] as GameStatus; .appx package

The Application.Suspending Event App.xaml.cs public App() { this.InitializeComponent(); this.Suspending += OnSuspending; } private async void OnSuspending(object sender, SuspendingEventArgs e) var deferral = e.SuspendingOperation.GetDeferral(); //serializes Page States and SessionState to local StorageFile await SuspensionManager.SaveAsync(); deferral.Complete(); .appx package

Page State Management with SuspensionManager .appx package

Page State Management with SuspensionManager LayoutAwarePage Code Behind - Saving protected override void SaveState(Dictionary<String, Object> pageState) { pageState.Add("greetingOutputText", greetingOutput.Text) } LayoutAwarePage Code Behind - Restoring protected override void LoadState(Object navigationParameter, Dictionary<String, Object> pageState) { if (pageState == null) //Do Page State initialization else greetingOutput.Text = pageState["greetingOutputText"].ToString(); } .appx package

Restoring State in Windows Store Apps .appx package

Storing User Preferences iOS - NSUserDefaults [[NSUserDefaults standardUserDefaults] setObject:@”ejeffers” forKey:MYAppDefaultsUsername]; Windows Store Apps – Local Settings ApplicationDataContainer settings = ApplicationData.Current.LocalSettings; settings.Values[”Username"] = ”ejeffers"; Windows Store Apps – Roaming Settings ApplicationDataContainer settings = ApplicationData.Current.RoamingSettings; settings.Values[”Username"] = ”ejeffers";

demo Suspending and Resuming 11/19/2018 12:03 AM © 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.

Application Activations Abbreviated iOS activations Windows Store Apps Activations .appx package

Activation By Contract .appx package

Application Activations – Entry Points Windows Store App Activations .appx package

The Background Task Contract

Background Tasks: Registration private void RegisterBackgroundTask() { BackgroundTaskBuilder builder = new BackgroundTaskBuilder(); builder.Name = "FlickrBackgroundSearchTask"; builder.TaskEntryPoint = "FlickrBackgroundTasks.FlickrSearchTask"; IBackgroundTrigger trigger = new TimeTrigger(15, true); builder.SetTrigger(trigger); IBackgroundCondition condition = new SystemCondition(SystemConditionType.InternetAvailable); builder.AddCondition(condition); IBackgroundTaskRegistration task = builder.Register(); }

Background Tasks: A Simple Implementation namespace BackgroundTasks { public sealed class FlickrSearchTask : IBackgroundTask async void Run(IBackgroundTaskInstance taskInstance) var _deferral = taskInstance.GetDeferral(); HttpResponseMessage response = await client.GetAsync(queryUrl); String jsonString = await response.Content.ReadAsStringAsync(); await FileIO.WriteTextAsync(currentSearchResultsFile, jsonString); updateLiveTile(); _deferral.Complete(); }

Background Tasks: Background Task Flow

Background Tasks: Trigger Types Trigger name Description TimeTrigger Trigger Runs on a Timer (15 minute minimum period) PushNotificationTrigger A Push Notification was received for the App ControlChannelTrigger Chat Programs, Audio Lock Screen Triggers Trigger name Description InternetAvailable The Internet becomes available. NetworkStateChange A network change such as a change in cost or connectivity occurs. OnlineIdConnectedStateChange Online ID associated with the account changes. SmsReceived A new SMS message is received by an installed mobile broadband device. TimeZoneChange The time zone changes on the device (for example, when the system adjusts the clock for daylight saving time). System Triggers (non-lock screen)

Background Tasks: Resource Limits CPU Quota Example Wifi Quota (~1Mbps on battery)

Recap: App Model App Package and Model Process Lifecycle 11/19/2018 Recap: App Model App Package and Model Process Lifecycle Background Tasks Declare Capabilities in AppxManifest Save State with Suspending Event using Suspension Manager Use Background Tasks to keep app fresh when not running © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.