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
![Page 1: 22 universal apps for windows](https://reader033.vdocuments.net/reader033/viewer/2022050920/54c50d3d4a7959226f8b460f/html5/thumbnails/1.jpg)
Universal Apps for Windows
![Page 2: 22 universal apps for windows](https://reader033.vdocuments.net/reader033/viewer/2022050920/54c50d3d4a7959226f8b460f/html5/thumbnails/2.jpg)
This module…
Universal Apps OverviewConvergence summaryTurning a project universal
Code Sharing StrategiesUniversal + PCL
![Page 3: 22 universal apps for windows](https://reader033.vdocuments.net/reader033/viewer/2022050920/54c50d3d4a7959226f8b460f/html5/thumbnails/3.jpg)
Universal Apps Overview
![Page 4: 22 universal apps for windows](https://reader033.vdocuments.net/reader033/viewer/2022050920/54c50d3d4a7959226f8b460f/html5/thumbnails/4.jpg)
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
![Page 5: 22 universal apps for windows](https://reader033.vdocuments.net/reader033/viewer/2022050920/54c50d3d4a7959226f8b460f/html5/thumbnails/5.jpg)
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
![Page 6: 22 universal apps for windows](https://reader033.vdocuments.net/reader033/viewer/2022050920/54c50d3d4a7959226f8b460f/html5/thumbnails/6.jpg)
Existing Windows 8.1 app can add Windows Phone 8.1 with shared project (and vice versa)
Convert Project to Universal
![Page 7: 22 universal apps for windows](https://reader033.vdocuments.net/reader033/viewer/2022050920/54c50d3d4a7959226f8b460f/html5/thumbnails/7.jpg)
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
![Page 8: 22 universal apps for windows](https://reader033.vdocuments.net/reader033/viewer/2022050920/54c50d3d4a7959226f8b460f/html5/thumbnails/8.jpg)
Windows 8.1 Universal App
demo
![Page 9: 22 universal apps for windows](https://reader033.vdocuments.net/reader033/viewer/2022050920/54c50d3d4a7959226f8b460f/html5/thumbnails/9.jpg)
Code Sharing Strategies
![Page 10: 22 universal apps for windows](https://reader033.vdocuments.net/reader033/viewer/2022050920/54c50d3d4a7959226f8b460f/html5/thumbnails/10.jpg)
Shared Project FilesMost File Types
Portable Class LibraryLibraries & Windows Runtime
Components“Add As Link”
Code Sharing Options
![Page 11: 22 universal apps for windows](https://reader033.vdocuments.net/reader033/viewer/2022050920/54c50d3d4a7959226f8b460f/html5/thumbnails/11.jpg)
Allow sharing source between converged appsNo binary outputSupports all items
Code filesXAMLImagesXML/JSONRESW
Shared Projects
![Page 12: 22 universal apps for windows](https://reader033.vdocuments.net/reader033/viewer/2022050920/54c50d3d4a7959226f8b460f/html5/thumbnails/12.jpg)
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
![Page 13: 22 universal apps for windows](https://reader033.vdocuments.net/reader033/viewer/2022050920/54c50d3d4a7959226f8b460f/html5/thumbnails/13.jpg)
For Windows Universal AppsSupports WinRT APIs
Output Windows Runtime Component
Expose libraries to C++, Javascript apps
Portable Class Libraries
![Page 14: 22 universal apps for windows](https://reader033.vdocuments.net/reader033/viewer/2022050920/54c50d3d4a7959226f8b460f/html5/thumbnails/14.jpg)
For Windows Universal AppsSupports WinRT APIs
Output Windows Runtime Component
Expose libraries to C++, Javascript apps
Broad Targeting for WP8, .NET
Portable Class Libraries
![Page 15: 22 universal apps for windows](https://reader033.vdocuments.net/reader033/viewer/2022050920/54c50d3d4a7959226f8b460f/html5/thumbnails/15.jpg)
Similar to Shared fileCompiler conditionals to share
across additional platforms
“Add As Link”
![Page 16: 22 universal apps for windows](https://reader033.vdocuments.net/reader033/viewer/2022050920/54c50d3d4a7959226f8b460f/html5/thumbnails/16.jpg)
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
![Page 17: 22 universal apps for windows](https://reader033.vdocuments.net/reader033/viewer/2022050920/54c50d3d4a7959226f8b460f/html5/thumbnails/17.jpg)
Universal App + PCL
demo
![Page 18: 22 universal apps for windows](https://reader033.vdocuments.net/reader033/viewer/2022050920/54c50d3d4a7959226f8b460f/html5/thumbnails/18.jpg)
Summary
![Page 19: 22 universal apps for windows](https://reader033.vdocuments.net/reader033/viewer/2022050920/54c50d3d4a7959226f8b460f/html5/thumbnails/19.jpg)
©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.