22 universal apps for windows
DESCRIPTION
Building Apps for Windows Phone 8.1 Jump Start . Videos at: http://channel9.msdn.com/Series/Building-Apps-for-Windows-Phone-8-1TRANSCRIPT
Universal Apps for Windows
This module…
Universal Apps OverviewConvergence summaryTurning a project universal
Code Sharing StrategiesUniversal + PCL
Universal Apps Overview
Applications on the converged Windows 8.1 and Windows Phone 8.1 platforms
Supported for C#, C++, and Javascript
Create universal apps using project templates or add Windows Phone 8.1 app to an existing Windows 8.1 app
Universal Apps
How Converged Is Windows?
Classes Structs Interfaces
Windows 8.1 SDK 566 119 59
Windows Phone 8.1 SDK 624 131 57
+58 +12 -2
Existing Windows 8.1 app can add Windows Phone 8.1 with shared project (and vice versa)
Convert Project to Universal
Use #if to navigate differences between Windows and PhoneWindows = WINDOWS_APPWindows Phone = WINDOWS_PHONE_APP
Example: Hardware back button is Windows Phone only
#if Compiler Conditionals
#if WINDOWS_PHONE_APPWindows.Phone.UI.Input.HardwareButtons.BackPressed +=
this.HardwareButtons_BackPressed;#endif
Windows 8.1 Universal App
demo
Code Sharing Strategies
Shared Project FilesMost File Types
Portable Class LibraryLibraries & Windows Runtime
Components“Add As Link”
Code Sharing Options
Allow sharing source between converged appsNo binary outputSupports all items
Code filesXAMLImagesXML/JSONRESW
Shared Projects
Cross-Platform XAML
Visual State Manager to handle layout changes
Session 6: Adaptive UI for Differing Screens
Shared XAML Components
#if WINDOWS_APP var result = VisualStateManager.GoToState(this, "Windows", false);#elif WINDOWS_PHONE_APP var result = VisualStateManager.GoToState(this, "WindowsPhone", false);#endif
For Windows Universal AppsSupports WinRT APIs
Output Windows Runtime Component
Expose libraries to C++, Javascript apps
Portable Class Libraries
For Windows Universal AppsSupports WinRT APIs
Output Windows Runtime Component
Expose libraries to C++, Javascript apps
Broad Targeting for WP8, .NET
Portable Class Libraries
Similar to Shared fileCompiler conditionals to share
across additional platforms
“Add As Link”
Separation of ConcernsDecouple UI from logic
UI In the Windows/Windows Phone projectsplus platform specific API sets (some geolocation, media,
sensors)
Logic in Shared projectplus XAML components that “make sense”
Code Sharing Architecture
Universal App + PCL
demo
Summary
©2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.