Upload
shahed-chowdhuri
View
985
Download
1
Embed Size (px)
Citation preview
Deeper Into Windows 10 DevelopmentUniversal Windows Apps
Shahed ChowdhuriSr Technical Evangelist Microsoft WakeUpAndCodecom
AgendaQuick Overview
One WindowsMany devices
Windows 10 App DevelopmentBuild 2015MSDN Channel 9Microsoft Virtual Academy
DemosPublic projects from Github
Windows CoreThe refactored common coreOne hardware platformUniversal hardware driverStandard network and IO
PhoneDevice
XboxDevice
DesktopDevice
Windows Core
DesktopSKU
PhoneSKU
XboxSKU
One Windows
DesktopSKU
PC
2 in 1
MobileSKU
Tablet
Phablet
Phone
XboxSKU
Xbox
IoTSKU
Band
IoT headless
SKU
Raspberry Pi
Home Automati
on
Surface HubSKU
Surface Hub
HolographicSKU
HoloLens
Phone Small Tablet
2-in-1s(Tablet or Laptop)
Desktops amp All-in-OnesPhablet Large Tablet
Classic Laptop
Xbox IoTSurface Hub
Holographic
Windows 10
Multiple device families
PC XBoxMobile Surface Hub
HoloLensDevices +IoT
Universal Windows Apps
One Store +One Dev Center
Reuse Existing CodeOne SDK +
Tooling
Adaptive User Interface Natural
User Inputs
One Universal Windows Platform
Windows 10operating system
Bridging technologies
Win32
desktop
Webhosted
JavaAndroid
ObjCiOS
Universal Windows Platform
WWAC++amp CX
Netlanguages
HTMLDirectX
XAML
C++
Netlanguages
MFCWFWPF
Netruntime
Apps dont target Windows 10 apps target the platform
Windows store packagingFeature WP XAP 81 WP AppX 81 AppX 81 AppX 10x
Platform WP 81+ WP 81 Win 81 Win 10
Device OS Build version targeting
Encryption (not yet)
App Bundles
Debug Package Signing
Differential DownloadUpdate
File Single Instancing
External Volume (SD) Installation (Win 10)
Shared publisher storage
Windows store distribution
Windows Phone 7x 8x Windows 8x Windows 10
Hidden apps
Per market pricing
Independent IAP publishing
Betas flighting
Time based trials
App discounts
Scheduled publish
ConsiderationsBest practicesConsider ads during the design phaseShow video ads during natural breaksAssociate ads with real up-sides
Worst practicesShowing ads at app-startInterrupt the userrsquos workflowBack-to-back ads
In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif
The Windows store provides many ways to monetize your app
The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements
Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements
First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability
Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch
Classic BlendResourcesDataStoryboardsStatesBehaviors
App bars and commandsltAppBar gt
ltCommandBar gt
ltAppBarButton Label= Icon= gt
ltAppBarToggleButton IsChecked= gt
ltAppBarSeparator gt
The XAML UI platform is foundational to Windows
xBindCompiled bindingBindings are committed at compile-time
Strongly-typed bindingDuck binding is not supported
Default mode is OneTimeOneWay and TwoWay are still available
Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged
SyntaxltTextBox Text=Binding
ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltListView ItemsSource=xBind ViewModelEmployeesgt
ltListViewItemTemplategt
ltDataTemplate xDataType=modelEmployeegt
ltGridgt
ltTextBlock Text=xBind Namegt
ltGridgt
ltDataTemplategt
ltListViewItemTemplategt
ltListViewgt
Data Templates
When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel
Dictionary graphsUse Binding with JSON or other untyped objects
Code-behind bindingCan addremove xBind runtime
Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style
xBind can meet your binding needs most of the time
StartupMemory
Benefits on the universal platform
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
AgendaQuick Overview
One WindowsMany devices
Windows 10 App DevelopmentBuild 2015MSDN Channel 9Microsoft Virtual Academy
DemosPublic projects from Github
Windows CoreThe refactored common coreOne hardware platformUniversal hardware driverStandard network and IO
PhoneDevice
XboxDevice
DesktopDevice
Windows Core
DesktopSKU
PhoneSKU
XboxSKU
One Windows
DesktopSKU
PC
2 in 1
MobileSKU
Tablet
Phablet
Phone
XboxSKU
Xbox
IoTSKU
Band
IoT headless
SKU
Raspberry Pi
Home Automati
on
Surface HubSKU
Surface Hub
HolographicSKU
HoloLens
Phone Small Tablet
2-in-1s(Tablet or Laptop)
Desktops amp All-in-OnesPhablet Large Tablet
Classic Laptop
Xbox IoTSurface Hub
Holographic
Windows 10
Multiple device families
PC XBoxMobile Surface Hub
HoloLensDevices +IoT
Universal Windows Apps
One Store +One Dev Center
Reuse Existing CodeOne SDK +
Tooling
Adaptive User Interface Natural
User Inputs
One Universal Windows Platform
Windows 10operating system
Bridging technologies
Win32
desktop
Webhosted
JavaAndroid
ObjCiOS
Universal Windows Platform
WWAC++amp CX
Netlanguages
HTMLDirectX
XAML
C++
Netlanguages
MFCWFWPF
Netruntime
Apps dont target Windows 10 apps target the platform
Windows store packagingFeature WP XAP 81 WP AppX 81 AppX 81 AppX 10x
Platform WP 81+ WP 81 Win 81 Win 10
Device OS Build version targeting
Encryption (not yet)
App Bundles
Debug Package Signing
Differential DownloadUpdate
File Single Instancing
External Volume (SD) Installation (Win 10)
Shared publisher storage
Windows store distribution
Windows Phone 7x 8x Windows 8x Windows 10
Hidden apps
Per market pricing
Independent IAP publishing
Betas flighting
Time based trials
App discounts
Scheduled publish
ConsiderationsBest practicesConsider ads during the design phaseShow video ads during natural breaksAssociate ads with real up-sides
Worst practicesShowing ads at app-startInterrupt the userrsquos workflowBack-to-back ads
In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif
The Windows store provides many ways to monetize your app
The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements
Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements
First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability
Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch
Classic BlendResourcesDataStoryboardsStatesBehaviors
App bars and commandsltAppBar gt
ltCommandBar gt
ltAppBarButton Label= Icon= gt
ltAppBarToggleButton IsChecked= gt
ltAppBarSeparator gt
The XAML UI platform is foundational to Windows
xBindCompiled bindingBindings are committed at compile-time
Strongly-typed bindingDuck binding is not supported
Default mode is OneTimeOneWay and TwoWay are still available
Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged
SyntaxltTextBox Text=Binding
ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltListView ItemsSource=xBind ViewModelEmployeesgt
ltListViewItemTemplategt
ltDataTemplate xDataType=modelEmployeegt
ltGridgt
ltTextBlock Text=xBind Namegt
ltGridgt
ltDataTemplategt
ltListViewItemTemplategt
ltListViewgt
Data Templates
When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel
Dictionary graphsUse Binding with JSON or other untyped objects
Code-behind bindingCan addremove xBind runtime
Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style
xBind can meet your binding needs most of the time
StartupMemory
Benefits on the universal platform
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Windows CoreThe refactored common coreOne hardware platformUniversal hardware driverStandard network and IO
PhoneDevice
XboxDevice
DesktopDevice
Windows Core
DesktopSKU
PhoneSKU
XboxSKU
One Windows
DesktopSKU
PC
2 in 1
MobileSKU
Tablet
Phablet
Phone
XboxSKU
Xbox
IoTSKU
Band
IoT headless
SKU
Raspberry Pi
Home Automati
on
Surface HubSKU
Surface Hub
HolographicSKU
HoloLens
Phone Small Tablet
2-in-1s(Tablet or Laptop)
Desktops amp All-in-OnesPhablet Large Tablet
Classic Laptop
Xbox IoTSurface Hub
Holographic
Windows 10
Multiple device families
PC XBoxMobile Surface Hub
HoloLensDevices +IoT
Universal Windows Apps
One Store +One Dev Center
Reuse Existing CodeOne SDK +
Tooling
Adaptive User Interface Natural
User Inputs
One Universal Windows Platform
Windows 10operating system
Bridging technologies
Win32
desktop
Webhosted
JavaAndroid
ObjCiOS
Universal Windows Platform
WWAC++amp CX
Netlanguages
HTMLDirectX
XAML
C++
Netlanguages
MFCWFWPF
Netruntime
Apps dont target Windows 10 apps target the platform
Windows store packagingFeature WP XAP 81 WP AppX 81 AppX 81 AppX 10x
Platform WP 81+ WP 81 Win 81 Win 10
Device OS Build version targeting
Encryption (not yet)
App Bundles
Debug Package Signing
Differential DownloadUpdate
File Single Instancing
External Volume (SD) Installation (Win 10)
Shared publisher storage
Windows store distribution
Windows Phone 7x 8x Windows 8x Windows 10
Hidden apps
Per market pricing
Independent IAP publishing
Betas flighting
Time based trials
App discounts
Scheduled publish
ConsiderationsBest practicesConsider ads during the design phaseShow video ads during natural breaksAssociate ads with real up-sides
Worst practicesShowing ads at app-startInterrupt the userrsquos workflowBack-to-back ads
In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif
The Windows store provides many ways to monetize your app
The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements
Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements
First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability
Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch
Classic BlendResourcesDataStoryboardsStatesBehaviors
App bars and commandsltAppBar gt
ltCommandBar gt
ltAppBarButton Label= Icon= gt
ltAppBarToggleButton IsChecked= gt
ltAppBarSeparator gt
The XAML UI platform is foundational to Windows
xBindCompiled bindingBindings are committed at compile-time
Strongly-typed bindingDuck binding is not supported
Default mode is OneTimeOneWay and TwoWay are still available
Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged
SyntaxltTextBox Text=Binding
ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltListView ItemsSource=xBind ViewModelEmployeesgt
ltListViewItemTemplategt
ltDataTemplate xDataType=modelEmployeegt
ltGridgt
ltTextBlock Text=xBind Namegt
ltGridgt
ltDataTemplategt
ltListViewItemTemplategt
ltListViewgt
Data Templates
When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel
Dictionary graphsUse Binding with JSON or other untyped objects
Code-behind bindingCan addremove xBind runtime
Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style
xBind can meet your binding needs most of the time
StartupMemory
Benefits on the universal platform
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
One Windows
DesktopSKU
PC
2 in 1
MobileSKU
Tablet
Phablet
Phone
XboxSKU
Xbox
IoTSKU
Band
IoT headless
SKU
Raspberry Pi
Home Automati
on
Surface HubSKU
Surface Hub
HolographicSKU
HoloLens
Phone Small Tablet
2-in-1s(Tablet or Laptop)
Desktops amp All-in-OnesPhablet Large Tablet
Classic Laptop
Xbox IoTSurface Hub
Holographic
Windows 10
Multiple device families
PC XBoxMobile Surface Hub
HoloLensDevices +IoT
Universal Windows Apps
One Store +One Dev Center
Reuse Existing CodeOne SDK +
Tooling
Adaptive User Interface Natural
User Inputs
One Universal Windows Platform
Windows 10operating system
Bridging technologies
Win32
desktop
Webhosted
JavaAndroid
ObjCiOS
Universal Windows Platform
WWAC++amp CX
Netlanguages
HTMLDirectX
XAML
C++
Netlanguages
MFCWFWPF
Netruntime
Apps dont target Windows 10 apps target the platform
Windows store packagingFeature WP XAP 81 WP AppX 81 AppX 81 AppX 10x
Platform WP 81+ WP 81 Win 81 Win 10
Device OS Build version targeting
Encryption (not yet)
App Bundles
Debug Package Signing
Differential DownloadUpdate
File Single Instancing
External Volume (SD) Installation (Win 10)
Shared publisher storage
Windows store distribution
Windows Phone 7x 8x Windows 8x Windows 10
Hidden apps
Per market pricing
Independent IAP publishing
Betas flighting
Time based trials
App discounts
Scheduled publish
ConsiderationsBest practicesConsider ads during the design phaseShow video ads during natural breaksAssociate ads with real up-sides
Worst practicesShowing ads at app-startInterrupt the userrsquos workflowBack-to-back ads
In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif
The Windows store provides many ways to monetize your app
The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements
Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements
First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability
Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch
Classic BlendResourcesDataStoryboardsStatesBehaviors
App bars and commandsltAppBar gt
ltCommandBar gt
ltAppBarButton Label= Icon= gt
ltAppBarToggleButton IsChecked= gt
ltAppBarSeparator gt
The XAML UI platform is foundational to Windows
xBindCompiled bindingBindings are committed at compile-time
Strongly-typed bindingDuck binding is not supported
Default mode is OneTimeOneWay and TwoWay are still available
Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged
SyntaxltTextBox Text=Binding
ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltListView ItemsSource=xBind ViewModelEmployeesgt
ltListViewItemTemplategt
ltDataTemplate xDataType=modelEmployeegt
ltGridgt
ltTextBlock Text=xBind Namegt
ltGridgt
ltDataTemplategt
ltListViewItemTemplategt
ltListViewgt
Data Templates
When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel
Dictionary graphsUse Binding with JSON or other untyped objects
Code-behind bindingCan addremove xBind runtime
Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style
xBind can meet your binding needs most of the time
StartupMemory
Benefits on the universal platform
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Phone Small Tablet
2-in-1s(Tablet or Laptop)
Desktops amp All-in-OnesPhablet Large Tablet
Classic Laptop
Xbox IoTSurface Hub
Holographic
Windows 10
Multiple device families
PC XBoxMobile Surface Hub
HoloLensDevices +IoT
Universal Windows Apps
One Store +One Dev Center
Reuse Existing CodeOne SDK +
Tooling
Adaptive User Interface Natural
User Inputs
One Universal Windows Platform
Windows 10operating system
Bridging technologies
Win32
desktop
Webhosted
JavaAndroid
ObjCiOS
Universal Windows Platform
WWAC++amp CX
Netlanguages
HTMLDirectX
XAML
C++
Netlanguages
MFCWFWPF
Netruntime
Apps dont target Windows 10 apps target the platform
Windows store packagingFeature WP XAP 81 WP AppX 81 AppX 81 AppX 10x
Platform WP 81+ WP 81 Win 81 Win 10
Device OS Build version targeting
Encryption (not yet)
App Bundles
Debug Package Signing
Differential DownloadUpdate
File Single Instancing
External Volume (SD) Installation (Win 10)
Shared publisher storage
Windows store distribution
Windows Phone 7x 8x Windows 8x Windows 10
Hidden apps
Per market pricing
Independent IAP publishing
Betas flighting
Time based trials
App discounts
Scheduled publish
ConsiderationsBest practicesConsider ads during the design phaseShow video ads during natural breaksAssociate ads with real up-sides
Worst practicesShowing ads at app-startInterrupt the userrsquos workflowBack-to-back ads
In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif
The Windows store provides many ways to monetize your app
The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements
Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements
First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability
Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch
Classic BlendResourcesDataStoryboardsStatesBehaviors
App bars and commandsltAppBar gt
ltCommandBar gt
ltAppBarButton Label= Icon= gt
ltAppBarToggleButton IsChecked= gt
ltAppBarSeparator gt
The XAML UI platform is foundational to Windows
xBindCompiled bindingBindings are committed at compile-time
Strongly-typed bindingDuck binding is not supported
Default mode is OneTimeOneWay and TwoWay are still available
Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged
SyntaxltTextBox Text=Binding
ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltListView ItemsSource=xBind ViewModelEmployeesgt
ltListViewItemTemplategt
ltDataTemplate xDataType=modelEmployeegt
ltGridgt
ltTextBlock Text=xBind Namegt
ltGridgt
ltDataTemplategt
ltListViewItemTemplategt
ltListViewgt
Data Templates
When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel
Dictionary graphsUse Binding with JSON or other untyped objects
Code-behind bindingCan addremove xBind runtime
Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style
xBind can meet your binding needs most of the time
StartupMemory
Benefits on the universal platform
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Multiple device families
PC XBoxMobile Surface Hub
HoloLensDevices +IoT
Universal Windows Apps
One Store +One Dev Center
Reuse Existing CodeOne SDK +
Tooling
Adaptive User Interface Natural
User Inputs
One Universal Windows Platform
Windows 10operating system
Bridging technologies
Win32
desktop
Webhosted
JavaAndroid
ObjCiOS
Universal Windows Platform
WWAC++amp CX
Netlanguages
HTMLDirectX
XAML
C++
Netlanguages
MFCWFWPF
Netruntime
Apps dont target Windows 10 apps target the platform
Windows store packagingFeature WP XAP 81 WP AppX 81 AppX 81 AppX 10x
Platform WP 81+ WP 81 Win 81 Win 10
Device OS Build version targeting
Encryption (not yet)
App Bundles
Debug Package Signing
Differential DownloadUpdate
File Single Instancing
External Volume (SD) Installation (Win 10)
Shared publisher storage
Windows store distribution
Windows Phone 7x 8x Windows 8x Windows 10
Hidden apps
Per market pricing
Independent IAP publishing
Betas flighting
Time based trials
App discounts
Scheduled publish
ConsiderationsBest practicesConsider ads during the design phaseShow video ads during natural breaksAssociate ads with real up-sides
Worst practicesShowing ads at app-startInterrupt the userrsquos workflowBack-to-back ads
In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif
The Windows store provides many ways to monetize your app
The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements
Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements
First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability
Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch
Classic BlendResourcesDataStoryboardsStatesBehaviors
App bars and commandsltAppBar gt
ltCommandBar gt
ltAppBarButton Label= Icon= gt
ltAppBarToggleButton IsChecked= gt
ltAppBarSeparator gt
The XAML UI platform is foundational to Windows
xBindCompiled bindingBindings are committed at compile-time
Strongly-typed bindingDuck binding is not supported
Default mode is OneTimeOneWay and TwoWay are still available
Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged
SyntaxltTextBox Text=Binding
ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltListView ItemsSource=xBind ViewModelEmployeesgt
ltListViewItemTemplategt
ltDataTemplate xDataType=modelEmployeegt
ltGridgt
ltTextBlock Text=xBind Namegt
ltGridgt
ltDataTemplategt
ltListViewItemTemplategt
ltListViewgt
Data Templates
When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel
Dictionary graphsUse Binding with JSON or other untyped objects
Code-behind bindingCan addremove xBind runtime
Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style
xBind can meet your binding needs most of the time
StartupMemory
Benefits on the universal platform
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Windows 10operating system
Bridging technologies
Win32
desktop
Webhosted
JavaAndroid
ObjCiOS
Universal Windows Platform
WWAC++amp CX
Netlanguages
HTMLDirectX
XAML
C++
Netlanguages
MFCWFWPF
Netruntime
Apps dont target Windows 10 apps target the platform
Windows store packagingFeature WP XAP 81 WP AppX 81 AppX 81 AppX 10x
Platform WP 81+ WP 81 Win 81 Win 10
Device OS Build version targeting
Encryption (not yet)
App Bundles
Debug Package Signing
Differential DownloadUpdate
File Single Instancing
External Volume (SD) Installation (Win 10)
Shared publisher storage
Windows store distribution
Windows Phone 7x 8x Windows 8x Windows 10
Hidden apps
Per market pricing
Independent IAP publishing
Betas flighting
Time based trials
App discounts
Scheduled publish
ConsiderationsBest practicesConsider ads during the design phaseShow video ads during natural breaksAssociate ads with real up-sides
Worst practicesShowing ads at app-startInterrupt the userrsquos workflowBack-to-back ads
In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif
The Windows store provides many ways to monetize your app
The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements
Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements
First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability
Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch
Classic BlendResourcesDataStoryboardsStatesBehaviors
App bars and commandsltAppBar gt
ltCommandBar gt
ltAppBarButton Label= Icon= gt
ltAppBarToggleButton IsChecked= gt
ltAppBarSeparator gt
The XAML UI platform is foundational to Windows
xBindCompiled bindingBindings are committed at compile-time
Strongly-typed bindingDuck binding is not supported
Default mode is OneTimeOneWay and TwoWay are still available
Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged
SyntaxltTextBox Text=Binding
ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltListView ItemsSource=xBind ViewModelEmployeesgt
ltListViewItemTemplategt
ltDataTemplate xDataType=modelEmployeegt
ltGridgt
ltTextBlock Text=xBind Namegt
ltGridgt
ltDataTemplategt
ltListViewItemTemplategt
ltListViewgt
Data Templates
When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel
Dictionary graphsUse Binding with JSON or other untyped objects
Code-behind bindingCan addremove xBind runtime
Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style
xBind can meet your binding needs most of the time
StartupMemory
Benefits on the universal platform
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Apps dont target Windows 10 apps target the platform
Windows store packagingFeature WP XAP 81 WP AppX 81 AppX 81 AppX 10x
Platform WP 81+ WP 81 Win 81 Win 10
Device OS Build version targeting
Encryption (not yet)
App Bundles
Debug Package Signing
Differential DownloadUpdate
File Single Instancing
External Volume (SD) Installation (Win 10)
Shared publisher storage
Windows store distribution
Windows Phone 7x 8x Windows 8x Windows 10
Hidden apps
Per market pricing
Independent IAP publishing
Betas flighting
Time based trials
App discounts
Scheduled publish
ConsiderationsBest practicesConsider ads during the design phaseShow video ads during natural breaksAssociate ads with real up-sides
Worst practicesShowing ads at app-startInterrupt the userrsquos workflowBack-to-back ads
In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif
The Windows store provides many ways to monetize your app
The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements
Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements
First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability
Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch
Classic BlendResourcesDataStoryboardsStatesBehaviors
App bars and commandsltAppBar gt
ltCommandBar gt
ltAppBarButton Label= Icon= gt
ltAppBarToggleButton IsChecked= gt
ltAppBarSeparator gt
The XAML UI platform is foundational to Windows
xBindCompiled bindingBindings are committed at compile-time
Strongly-typed bindingDuck binding is not supported
Default mode is OneTimeOneWay and TwoWay are still available
Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged
SyntaxltTextBox Text=Binding
ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltListView ItemsSource=xBind ViewModelEmployeesgt
ltListViewItemTemplategt
ltDataTemplate xDataType=modelEmployeegt
ltGridgt
ltTextBlock Text=xBind Namegt
ltGridgt
ltDataTemplategt
ltListViewItemTemplategt
ltListViewgt
Data Templates
When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel
Dictionary graphsUse Binding with JSON or other untyped objects
Code-behind bindingCan addremove xBind runtime
Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style
xBind can meet your binding needs most of the time
StartupMemory
Benefits on the universal platform
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Windows store packagingFeature WP XAP 81 WP AppX 81 AppX 81 AppX 10x
Platform WP 81+ WP 81 Win 81 Win 10
Device OS Build version targeting
Encryption (not yet)
App Bundles
Debug Package Signing
Differential DownloadUpdate
File Single Instancing
External Volume (SD) Installation (Win 10)
Shared publisher storage
Windows store distribution
Windows Phone 7x 8x Windows 8x Windows 10
Hidden apps
Per market pricing
Independent IAP publishing
Betas flighting
Time based trials
App discounts
Scheduled publish
ConsiderationsBest practicesConsider ads during the design phaseShow video ads during natural breaksAssociate ads with real up-sides
Worst practicesShowing ads at app-startInterrupt the userrsquos workflowBack-to-back ads
In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif
The Windows store provides many ways to monetize your app
The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements
Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements
First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability
Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch
Classic BlendResourcesDataStoryboardsStatesBehaviors
App bars and commandsltAppBar gt
ltCommandBar gt
ltAppBarButton Label= Icon= gt
ltAppBarToggleButton IsChecked= gt
ltAppBarSeparator gt
The XAML UI platform is foundational to Windows
xBindCompiled bindingBindings are committed at compile-time
Strongly-typed bindingDuck binding is not supported
Default mode is OneTimeOneWay and TwoWay are still available
Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged
SyntaxltTextBox Text=Binding
ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltListView ItemsSource=xBind ViewModelEmployeesgt
ltListViewItemTemplategt
ltDataTemplate xDataType=modelEmployeegt
ltGridgt
ltTextBlock Text=xBind Namegt
ltGridgt
ltDataTemplategt
ltListViewItemTemplategt
ltListViewgt
Data Templates
When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel
Dictionary graphsUse Binding with JSON or other untyped objects
Code-behind bindingCan addremove xBind runtime
Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style
xBind can meet your binding needs most of the time
StartupMemory
Benefits on the universal platform
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Windows store distribution
Windows Phone 7x 8x Windows 8x Windows 10
Hidden apps
Per market pricing
Independent IAP publishing
Betas flighting
Time based trials
App discounts
Scheduled publish
ConsiderationsBest practicesConsider ads during the design phaseShow video ads during natural breaksAssociate ads with real up-sides
Worst practicesShowing ads at app-startInterrupt the userrsquos workflowBack-to-back ads
In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif
The Windows store provides many ways to monetize your app
The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements
Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements
First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability
Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch
Classic BlendResourcesDataStoryboardsStatesBehaviors
App bars and commandsltAppBar gt
ltCommandBar gt
ltAppBarButton Label= Icon= gt
ltAppBarToggleButton IsChecked= gt
ltAppBarSeparator gt
The XAML UI platform is foundational to Windows
xBindCompiled bindingBindings are committed at compile-time
Strongly-typed bindingDuck binding is not supported
Default mode is OneTimeOneWay and TwoWay are still available
Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged
SyntaxltTextBox Text=Binding
ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltListView ItemsSource=xBind ViewModelEmployeesgt
ltListViewItemTemplategt
ltDataTemplate xDataType=modelEmployeegt
ltGridgt
ltTextBlock Text=xBind Namegt
ltGridgt
ltDataTemplategt
ltListViewItemTemplategt
ltListViewgt
Data Templates
When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel
Dictionary graphsUse Binding with JSON or other untyped objects
Code-behind bindingCan addremove xBind runtime
Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style
xBind can meet your binding needs most of the time
StartupMemory
Benefits on the universal platform
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
ConsiderationsBest practicesConsider ads during the design phaseShow video ads during natural breaksAssociate ads with real up-sides
Worst practicesShowing ads at app-startInterrupt the userrsquos workflowBack-to-back ads
In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif
The Windows store provides many ways to monetize your app
The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements
Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements
First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability
Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch
Classic BlendResourcesDataStoryboardsStatesBehaviors
App bars and commandsltAppBar gt
ltCommandBar gt
ltAppBarButton Label= Icon= gt
ltAppBarToggleButton IsChecked= gt
ltAppBarSeparator gt
The XAML UI platform is foundational to Windows
xBindCompiled bindingBindings are committed at compile-time
Strongly-typed bindingDuck binding is not supported
Default mode is OneTimeOneWay and TwoWay are still available
Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged
SyntaxltTextBox Text=Binding
ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltListView ItemsSource=xBind ViewModelEmployeesgt
ltListViewItemTemplategt
ltDataTemplate xDataType=modelEmployeegt
ltGridgt
ltTextBlock Text=xBind Namegt
ltGridgt
ltDataTemplategt
ltListViewItemTemplategt
ltListViewgt
Data Templates
When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel
Dictionary graphsUse Binding with JSON or other untyped objects
Code-behind bindingCan addremove xBind runtime
Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style
xBind can meet your binding needs most of the time
StartupMemory
Benefits on the universal platform
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif
The Windows store provides many ways to monetize your app
The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements
Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements
First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability
Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch
Classic BlendResourcesDataStoryboardsStatesBehaviors
App bars and commandsltAppBar gt
ltCommandBar gt
ltAppBarButton Label= Icon= gt
ltAppBarToggleButton IsChecked= gt
ltAppBarSeparator gt
The XAML UI platform is foundational to Windows
xBindCompiled bindingBindings are committed at compile-time
Strongly-typed bindingDuck binding is not supported
Default mode is OneTimeOneWay and TwoWay are still available
Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged
SyntaxltTextBox Text=Binding
ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltListView ItemsSource=xBind ViewModelEmployeesgt
ltListViewItemTemplategt
ltDataTemplate xDataType=modelEmployeegt
ltGridgt
ltTextBlock Text=xBind Namegt
ltGridgt
ltDataTemplategt
ltListViewItemTemplategt
ltListViewgt
Data Templates
When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel
Dictionary graphsUse Binding with JSON or other untyped objects
Code-behind bindingCan addremove xBind runtime
Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style
xBind can meet your binding needs most of the time
StartupMemory
Benefits on the universal platform
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
The Windows store provides many ways to monetize your app
The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements
Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements
First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability
Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch
Classic BlendResourcesDataStoryboardsStatesBehaviors
App bars and commandsltAppBar gt
ltCommandBar gt
ltAppBarButton Label= Icon= gt
ltAppBarToggleButton IsChecked= gt
ltAppBarSeparator gt
The XAML UI platform is foundational to Windows
xBindCompiled bindingBindings are committed at compile-time
Strongly-typed bindingDuck binding is not supported
Default mode is OneTimeOneWay and TwoWay are still available
Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged
SyntaxltTextBox Text=Binding
ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltListView ItemsSource=xBind ViewModelEmployeesgt
ltListViewItemTemplategt
ltDataTemplate xDataType=modelEmployeegt
ltGridgt
ltTextBlock Text=xBind Namegt
ltGridgt
ltDataTemplategt
ltListViewItemTemplategt
ltListViewgt
Data Templates
When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel
Dictionary graphsUse Binding with JSON or other untyped objects
Code-behind bindingCan addremove xBind runtime
Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style
xBind can meet your binding needs most of the time
StartupMemory
Benefits on the universal platform
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements
Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements
First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability
Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch
Classic BlendResourcesDataStoryboardsStatesBehaviors
App bars and commandsltAppBar gt
ltCommandBar gt
ltAppBarButton Label= Icon= gt
ltAppBarToggleButton IsChecked= gt
ltAppBarSeparator gt
The XAML UI platform is foundational to Windows
xBindCompiled bindingBindings are committed at compile-time
Strongly-typed bindingDuck binding is not supported
Default mode is OneTimeOneWay and TwoWay are still available
Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged
SyntaxltTextBox Text=Binding
ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltListView ItemsSource=xBind ViewModelEmployeesgt
ltListViewItemTemplategt
ltDataTemplate xDataType=modelEmployeegt
ltGridgt
ltTextBlock Text=xBind Namegt
ltGridgt
ltDataTemplategt
ltListViewItemTemplategt
ltListViewgt
Data Templates
When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel
Dictionary graphsUse Binding with JSON or other untyped objects
Code-behind bindingCan addremove xBind runtime
Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style
xBind can meet your binding needs most of the time
StartupMemory
Benefits on the universal platform
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch
Classic BlendResourcesDataStoryboardsStatesBehaviors
App bars and commandsltAppBar gt
ltCommandBar gt
ltAppBarButton Label= Icon= gt
ltAppBarToggleButton IsChecked= gt
ltAppBarSeparator gt
The XAML UI platform is foundational to Windows
xBindCompiled bindingBindings are committed at compile-time
Strongly-typed bindingDuck binding is not supported
Default mode is OneTimeOneWay and TwoWay are still available
Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged
SyntaxltTextBox Text=Binding
ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltListView ItemsSource=xBind ViewModelEmployeesgt
ltListViewItemTemplategt
ltDataTemplate xDataType=modelEmployeegt
ltGridgt
ltTextBlock Text=xBind Namegt
ltGridgt
ltDataTemplategt
ltListViewItemTemplategt
ltListViewgt
Data Templates
When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel
Dictionary graphsUse Binding with JSON or other untyped objects
Code-behind bindingCan addremove xBind runtime
Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style
xBind can meet your binding needs most of the time
StartupMemory
Benefits on the universal platform
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
App bars and commandsltAppBar gt
ltCommandBar gt
ltAppBarButton Label= Icon= gt
ltAppBarToggleButton IsChecked= gt
ltAppBarSeparator gt
The XAML UI platform is foundational to Windows
xBindCompiled bindingBindings are committed at compile-time
Strongly-typed bindingDuck binding is not supported
Default mode is OneTimeOneWay and TwoWay are still available
Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged
SyntaxltTextBox Text=Binding
ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltListView ItemsSource=xBind ViewModelEmployeesgt
ltListViewItemTemplategt
ltDataTemplate xDataType=modelEmployeegt
ltGridgt
ltTextBlock Text=xBind Namegt
ltGridgt
ltDataTemplategt
ltListViewItemTemplategt
ltListViewgt
Data Templates
When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel
Dictionary graphsUse Binding with JSON or other untyped objects
Code-behind bindingCan addremove xBind runtime
Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style
xBind can meet your binding needs most of the time
StartupMemory
Benefits on the universal platform
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
The XAML UI platform is foundational to Windows
xBindCompiled bindingBindings are committed at compile-time
Strongly-typed bindingDuck binding is not supported
Default mode is OneTimeOneWay and TwoWay are still available
Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged
SyntaxltTextBox Text=Binding
ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltListView ItemsSource=xBind ViewModelEmployeesgt
ltListViewItemTemplategt
ltDataTemplate xDataType=modelEmployeegt
ltGridgt
ltTextBlock Text=xBind Namegt
ltGridgt
ltDataTemplategt
ltListViewItemTemplategt
ltListViewgt
Data Templates
When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel
Dictionary graphsUse Binding with JSON or other untyped objects
Code-behind bindingCan addremove xBind runtime
Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style
xBind can meet your binding needs most of the time
StartupMemory
Benefits on the universal platform
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
xBindCompiled bindingBindings are committed at compile-time
Strongly-typed bindingDuck binding is not supported
Default mode is OneTimeOneWay and TwoWay are still available
Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged
SyntaxltTextBox Text=Binding
ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltListView ItemsSource=xBind ViewModelEmployeesgt
ltListViewItemTemplategt
ltDataTemplate xDataType=modelEmployeegt
ltGridgt
ltTextBlock Text=xBind Namegt
ltGridgt
ltDataTemplategt
ltListViewItemTemplategt
ltListViewgt
Data Templates
When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel
Dictionary graphsUse Binding with JSON or other untyped objects
Code-behind bindingCan addremove xBind runtime
Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style
xBind can meet your binding needs most of the time
StartupMemory
Benefits on the universal platform
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
SyntaxltTextBox Text=Binding
ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger
ltListView ItemsSource=xBind ViewModelEmployeesgt
ltListViewItemTemplategt
ltDataTemplate xDataType=modelEmployeegt
ltGridgt
ltTextBlock Text=xBind Namegt
ltGridgt
ltDataTemplategt
ltListViewItemTemplategt
ltListViewgt
Data Templates
When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel
Dictionary graphsUse Binding with JSON or other untyped objects
Code-behind bindingCan addremove xBind runtime
Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style
xBind can meet your binding needs most of the time
StartupMemory
Benefits on the universal platform
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
ltListView ItemsSource=xBind ViewModelEmployeesgt
ltListViewItemTemplategt
ltDataTemplate xDataType=modelEmployeegt
ltGridgt
ltTextBlock Text=xBind Namegt
ltGridgt
ltDataTemplategt
ltListViewItemTemplategt
ltListViewgt
Data Templates
When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel
Dictionary graphsUse Binding with JSON or other untyped objects
Code-behind bindingCan addremove xBind runtime
Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style
xBind can meet your binding needs most of the time
StartupMemory
Benefits on the universal platform
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel
Dictionary graphsUse Binding with JSON or other untyped objects
Code-behind bindingCan addremove xBind runtime
Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style
xBind can meet your binding needs most of the time
StartupMemory
Benefits on the universal platform
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
xBind can meet your binding needs most of the time
StartupMemory
Benefits on the universal platform
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
StartupMemory
Benefits on the universal platform
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt
ltGrid Width=200 Height=80gt
ltTextBlock Text=xBind DisplayName gt
ltTextBlock Text=xBind prettyDate xPhase=1gt
ltGridgt
ltDataTemplategt
Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered
4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)
Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
The fastest codeis the code you dont run
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Adaptive controls
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Input intelligence
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Scaling algorithm
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
As you design1 Adapt to size change
2 Adapt to input change
3 Build with effective pixels
4 Count on the scaling algorithm
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Adapt to different devices without targeting each and every device
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Visual StatesDefine XAML viewsUnique layout for distinct states
Simplify animationAutomatically implement state transitions
Build in BlendDesign and preview states and transitions
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Adaptive triggersCode-free state transition
Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)
ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Developers have many toolsto build an adaptive UI
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
What are Adaptive AppsWindows apps adapt to different versions of the platform
Windows apps adapt to different types of devices
Windows apps adapt to different screen sizes
Adaptive UI handles different screens
Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Windows 81 Universal Shared code two binaries
WindowsBinary Phone
Binary
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Extension SDKs
UWP
Windows Core Windows Core Windows Core Windows Core
UWP UWP UWP
Desktop Mobile Xbox Morehellip
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
The device families you choose determines which APIs you can call freely
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Locations where apps can access data
App
App Package Folder
ro
App data Folders
rwApp data FoldersApp data
Folders
Local
RoamingTemp
Removable
Storage (SD Card)
rw
Known Folders
PicturesVideosMusic- Direct access needs manifest capabilities
rw
Cloud
rw
File Syste
m
File OpenSave Picker
APIs
rw
Credential Locker
rwBground Transfer
Publishers Shared Folder
rw
AppApp
Picker Provider apps
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Package and App Data FoldersPackage Manager installs all app files into the App package Folder
Read-only access from app
Apps store data in Local Folder
Settings and properties in the app settings dictionaries
Data in files
Structured data in database files
Local or Roaming
Settings File
App CreatesManagesfiles and settings
ApplicationFiles
App Data Folder
Creates root folder
sandboxed to App
Package Manager
App Package Folder
WinRT Storage APIs
Install
DB
Database file
DB Files (ro)
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Directly Accessible RW Data Storage
RoamingFolde
rSettin
gs
bull Other devices can access what you put in here
bull Data roamed cross-device
bull Limited to 100KB per application
bull Held in OneDrive storage
LocalFolde
rSetting
s
bull Store local data here for use by your application
bull Can store data up to the limit of the storage on the device
bull Retained if the application is updated
TempFolde
r
bull Use for temporary storage
bull No guarantee it will still be here next time your program runs
bull Cleaned up in a low storage condition
WindowsStorageApplicationData WindowsSecurity
Credentials
PasswordVaultCredenti
als
bull Credential Locker
bull Use for secure storage of PasswordCred-ential objects
bull Data roamed cross-device
Publisher CacheFolde
r
bull Shared storage for apps from same publisher
bull Declare in app manifest
New
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
KnownFoldersPhysical View Logical View
CUsersPublicPicturesSeattle
DPicturesPortland
DPicturesBirthday
CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg
DPicturesPic01jpg
Internal storage
SD Card (if present)
KnownFoldersPicturesLibraryGetFilesAsync()
DPicturesPic02jpg
DPicturesHawaiiPic02jpg
StorageFile Pic01jpg
StorageFile Pic01jpg
StorageFile Pic02jpg
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Provide multiple options for the user to loadsave data
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable
Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian
and big endian
Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM
SQLitePCLSQL statementsThin wrapper around the SQLite C API
using (var conn = new SQLiteConnection(demodb)) Customer customer = null
using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))
statementBind(1 customerId) if (SQLiteResultDONE == statementStep())
customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]
var db = new SQLiteSQLiteAsyncConnection(AppDBPath)
var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()
if (customer = null) var Id = _customerId var Name = _customerName
hellipand others
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Installing the SQLite LibraryVisual Studio Extension (vsix)
Install from Visual StudioTools ndash Extensions and Updateshellip
Or download from SQLiteorg
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Installing SQLitePCL to your Solution
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Frameworks that use SQLiteEntity Framework 7Azure App Service
Mobile Apps
Easy to implement offline data sync uses SQLite for local data storage
01010001001011000100
Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
SQLite provides a convenient option for your app
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Enhanced App to App in Windows 10
Send file token send data
Launch a specific app
App Services
Launch for Results
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
URI Activation++
Invoke a specific app
var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
URI Activation++
Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt
var token = SharedStorageAccessManagerAddFile (gpxFile)
ValueSet inputData = new ValueSet()inputDataAdd(Token token)
var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Query URI Support
Discover if app already installed to handle a Uri
var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)
var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
App Services
Covered in separate module
Client App A
Client App B Background Task
App with App Service
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Apps on Windows 10 can communicate in new ways
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
String resources project StringsOff the root this is a convention
project Stringsen-USMatching the local identifier
project Stringsen-USResourcesreswResource file with localized strings
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Resource loaderAccess strings directlyDialogs errors validate
async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses
Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)
Outside Visual StudioFree community tool
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Localizing your app will help you succeed in more regions amp locales
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
App Lifecycle
Runningapp
Suspendedapp
Suspending Terminatedapp
Low memory
Resuming
Background task executes
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Handling suspension
public App() thisInitializeComponent()
thisSuspending += (s e) =gt Save data
thisResuming += (s e) =gt Load data
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI
Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)
Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely
Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)
var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)
try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Understanding the App Life Cycle facilitates a smoother experience
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work
Handling cancelationTasks can be cancelled by the app or operating system heuristics
Running in deferralBackground tasks do not have to operate asynchronously
Progress feedbackProgress is a numeric value
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Request Background Permission
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
System condition(s) [ if ]User Present
If the user is present
User Not PresentIf the user is not present
Internet AvailableIf the internet is available
Internet Not Available
If the internet is not available
Session ConnectedIf the user is logged in
Session DisconnectedIf the user is not logged in
Free Network AvailableIf a non-metered network is available
Work Cost Not HighIf background resources are plentiful
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Host tasks in foreground processtt
In-processSimplified communicationShares memory caps
Foreground app starts in appexeBackground task starts in appexe
Default processHosted in separate processSeparate memory cap
Default process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
In process
appexe
CoreApplication
BackgroundTask
backgroundtaskhostexe
App Container
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Background tasks can extend capabilities of your app
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
App Services
Client App A
Client App B
Background Task
App with App Service
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Scenario Bar Code Scanning
Bar Code decoding App
ServiceImage bytes in ValueSet or FileToken
Decoded data
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Scenario Enterprise suite of apps
App ServiceMaintains Inventory
cache
Client App A
Client App B
Interact with cloud services
App ServiceProximity Reading
Services
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services
Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request
Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
App services provides another way for applications to communicate with each other
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
12
Always up-to-dateUpdate frequentlySingle doc model
Always up-to-dateUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Firefox
Chrome
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Ever Green EngineUpdate frequentlySingle doc model
Ever Green EngineUpdate frequentlySingle doc model
13
34
14
35
Q
5
7
8
9
E
10
11
Always up-to-dateUpdate frequentlySingle doc model
Firefox
Chrome
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
User-Agent Strings
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120
Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125
Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736
Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350
Chrome
Safari
Firefox
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
EdgeHTMLdll Chakra
Hosted contentAlways up-to-date
Packaged contentOffline first
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Edge enables a better webapp experience
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Mobile Experiences - not just mobile devices
User is the center of the experience not the device
Available on the right device at the right time
Input model optimized for the experience
Enabling Mobile Experiences with Universal Apps
The Experience you want on the device you want
User
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
OS Settings Roaming in Windows 10
OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account
OS settings roam to OneDrive for Business for AAD identity
OS settings roam to OneDrive for MSA identity
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
App Settings Roaming in Windows 10
Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store
App settings roam to OneDrive for Business for apps acquired from the corporate store
App settings roam to OneDrive for apps acquired from the consumer store
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Roaming Data
UWP app ndash PFN 12345
Roaming
Local Temp
UWP app ndash PFN 12345
Roaming
LocalTemp
PFN 12345
Roamingfolder
App writes data using standard filesettings APIs
Sync engine transfers data periodically based on triggers (user idle battery network etc)
OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops
Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised
Roamingsettings
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Create shared mobile experiences whatever the device
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Navigation with FrameNavigateSend to a type
Pass a string
Navigation servicePart of Template 10 project template
private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Navigation parametersPageOnNavigatedTo()Standard in Windows
ViewModelOnNavigatedToWith Template 10 project template
public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button
With one improvementBacking out does not close the app
And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen
WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =
true
WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)
Opt-in to back in Windowed modeAutomatic in immersive
Some guidanceDonrsquot strand usersDonrsquot hijack back
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Navigation is easier to develop across device families
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
1 Need a token
2 App needs a token
3 Stored
6 Authenticate
7 Token
8 Token
9 Token
10 Gets data using the token
Web Account Manager
App
IdentityService Provider
Web Account Provider
UX
5 Creds4 Throw UI
Web Account Manager
Microsoft Web Account ProviderContoso Web Account Provider
Web Account Provider
YOUR
Browser
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Auth Filter
503 Retry Filter
Metered Network Filter
REST Web Service
HttpClient
GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync
PostAsync
PutAsync
SendRequestAsync
The filter pipeline Your app
HttpRequestMessage
HttpResponseMessage
Http Base Protocol Filter
Has in-depth settings
HttpContentString bull Stream bull Buffer
bull Multipart bull FormUrlEncoded
Your code This is also a filter
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Use existing networkcloud services to extend your application with little effort
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Basic State
Plate
App Logo
Short Name
Plate
App Logo
Short Name
Semi-Live State
Plate
App Logo
Short Name
Badge
Plate
App Logo
Short Name
Badge
Live State
Plate
App Icon
Short Name
Badge
Content
Plate
Short Name
Badge
App Icon
Content
Tile anatomy
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
ToastsGlance (consume)See new information from your apps
Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Toast states
Collapsed stateAction center chevron Mobile default
Expanded stateAction center chevron Desktop default
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Interactive toastDesktop
Mobile
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Tiles and toast notifications keep your users engaged
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Windows 8081 Store Apps
Windows 80
Minimal code update required
Responsive UX DesignImplementation
Windows 10
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Windows Phone 81 Store Apps (WinRT)
Windows Phone 81
Minor code updates for UAP APIs
Design UX for multiple form factors
Windows 10
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Windows 81 Universal Apps
Windows 81
Merge UX
Refactor to single code-base amp to target UAP APIs
Windows 10
Windows Phone 81
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Windows Phone Silverlight Apps
Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs
Windows Phone 7578
Windows Phone 80
Windows Phone 81
Port the UI Silverlight -gt Windows XAML
Rewrite code to target UAP APIs
Design UX for multiple form factors
Windows 10
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Win8 apps will run on Win10 but porting to UWP puts your app on more device families
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
LauncherLaunchUriAsync(new Uri(sampleappID=aea6))
LauncherLaunchFileAsync(file)
App to App Communication
URIProtocol Activation
Data in UriFile
UserOS chooses target
More on this in module 302 App to App Communication
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Share Contract
DataTransferManagerShowShareUI()
Share DataPackage
User chooses target
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt
My AppFile Explorer
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Desktop Share UX Changes In W10Windows 8x Windows 8x app running on
Windows 10
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Many apps will be a share sourceOnly a few will be a share target
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Next Steps
bull Start Here bull https
devwindowscomen-usdownloadswindows-10-developer-tools
bull Get Windows 10 httpmicrosoftcomwindows
bull Get Visual Studio 2015 httpakamsvs2015ce
bull MVA video series bull httpakamsmva-win10-dev
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
GitHub
bull UWP Samplesbull https
githubcomMicrosoftWindows-universal-samples
bull Template10 bull httpsgithubcomWindows-XAMLTemplate10
bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA
bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Build 2015
bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617
bull Whats New in XAML for Universal Windows Apps
bull httpschannel9msdncomEventsBuild20152-629
bull Game Developers Get the Most Out of Windows 10
bull httpschannel9msdncomEventsBuild20152-637
Contact
Email shchowdmicrosoftcom Twitter shahedC
Contact
Email shchowdmicrosoftcom Twitter shahedC