22 universal apps for windows

19
Universal Apps for Windows

Upload: windowsphonerocks

Post on 25-Jan-2015

165 views

Category:

Technology


0 download

DESCRIPTION

Building Apps for Windows Phone 8.1 Jump Start . Videos at: http://channel9.msdn.com/Series/Building-Apps-for-Windows-Phone-8-1

TRANSCRIPT

Page 1: 22   universal apps for windows

Universal Apps for Windows

Page 2: 22   universal apps for windows

This module…

Universal Apps OverviewConvergence summaryTurning a project universal

Code Sharing StrategiesUniversal + PCL

Page 3: 22   universal apps for windows

Universal Apps Overview

Page 4: 22   universal apps for windows

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

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

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

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

Windows 8.1 Universal App

demo

Page 9: 22   universal apps for windows

Code Sharing Strategies

Page 10: 22   universal apps for windows

Shared Project FilesMost File Types

Portable Class LibraryLibraries & Windows Runtime

Components“Add As Link”

Code Sharing Options

Page 11: 22   universal apps for windows

Allow sharing source between converged appsNo binary outputSupports all items

Code filesXAMLImagesXML/JSONRESW

Shared Projects

Page 12: 22   universal apps for windows

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

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

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

Similar to Shared fileCompiler conditionals to share

across additional platforms

“Add As Link”

Page 16: 22   universal apps for windows

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

Universal App + PCL

demo

Page 18: 22   universal apps for windows

Summary

Page 19: 22   universal apps for windows

©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.