an introduction to universal windows apps

17
An Introduction to Universal Windows Apps Ken Cenerelli @KenCenerelli

Upload: ken-cenerelli

Post on 16-Jul-2015

207 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: An Introduction to Universal Windows Apps

An Introduction to

Universal Windows Apps

Ken Cenerelli

@KenCenerelli

Page 2: An Introduction to Universal Windows Apps

What is it?

Build one app that targets Windows and Windows Phone

Provides a common experience, shared app identity, single app

purchase, shared in-app purchases and shared data/profile

It is not:

A single binary

A non-Windows application (i.e. Supporting Android & iOS)

A non-native HTML/JavaScript application (i.e. Apache Cordova)

Page 3: An Introduction to Universal Windows Apps

Overview

Announced in April 2014

Develop once for all Windows devices using a unified

Windows runtime and set of tools

Project structure comes from Linked Files, a technology since

the early days of .NET 2005

Page 4: An Introduction to Universal Windows Apps

Platform Convergence

Windows Phone 8.1, Windows 8 RT and Window 8.1 flavours of

Windows share a common runtime

Existing Windows 8 apps can be migrated to shared projects

Share code while just making tweaks to the UI

Silverlight Phone 8.0 apps work on 8.1 without upgrade

The Windows Runtime API & Microsoft SDKs are

around 90% converged and closing

Page 5: An Introduction to Universal Windows Apps

Why should you care?

Windows 10 is coming with a free upgrade for Windows 8 so

exponentially more adoption within the enterprise

Source: OS Platform Statistics, http://www.w3schools.com/browsers/browsers_os.asp

Flip side though is Windows Phone market share is 2.9%

compared to ~84% for Android and ~12% for iOSSource: Smartphone OS Market Share, Q3 2014, http://www.idc.com/prodserv/smartphone-os-market-share.jsp

Page 6: An Introduction to Universal Windows Apps

Things to know

Multiple languages supported (C# or C++ with XAML,

C++ with DirectX, and JavaScript with HTML/CSS)

The IDE is free

Must be Visual Studio 2013 with Update 2 or later

Works with the Express versions and the new Community Edition

Physical device nice to have but not essential

Requires a developer license for your computer

Needs a Microsoft account (i.e. Windows Live account)

Requires a developer account to publish ($20 CAD)

Page 7: An Introduction to Universal Windows Apps

Demo

Our first Universal Windows App

Page 8: An Introduction to Universal Windows Apps

How to share code? Before UA there were:

Linked Files

Portable Class Libraries

We now have:

Shared Projects (Conditional Compilation)

Partial Classes (Split the code across multiple files)

Portable Class Libraries

Base Classes

User Controls

Visibility

Page 9: An Introduction to Universal Windows Apps

Things to share

Reusable business logic (C# code)

Resources & Assets (images)

Views similar to both projects:

Login Page

Privacy Page

Page 10: An Introduction to Universal Windows Apps

Demo

Sharing code and views:

Shared Projects

Conditional Compilation

Partial Classes

XAML UI code

Page 11: An Introduction to Universal Windows Apps

Rules of Thumb Conditional Compilation

Can make code difficult to read

Solves small, quick-hit platform problems

Only supported when using the Shared project

Partial classes

Makes it easy to isolate platform code

Difficult to see the entirety of your code

Don’t expect to save time writing XAML

Do expect to save time writing implementation code

Page 12: An Introduction to Universal Windows Apps

Tips for design Think through the design for both platforms before you

start coding

If you keep the Microsoft design, it means that the user knows how to move around the app intuitively

Device variability: Default for tablet Is landscape and default for phone is portrait

It’s okay if each version doesn’t look the same and doesn’t have the same features

There is no silver bullet solution

There are just small choices you will make as you develop a pattern of practice

Page 13: An Introduction to Universal Windows Apps

Tips for development

Develop apps in sync to solve problems in parallel

Target lowest supported device for phone development

~50% of Windows Phone users use a low-end device

Startup both projects in the emulator at the same time

Use the Navigation Bar to segment your code per project

Optimize the user experience for the device they are on

Page 14: An Introduction to Universal Windows Apps

Testing

Unit Tests

Create separate unit test projects for each platform

Coded UI

Need Visual Studio Premium and Ultimate

Windows App Certification Kit (WACK)

Available as separate download

Windows Store app test cases

Page 15: An Introduction to Universal Windows Apps

Publishing

Reserve a name in the store for your app

Valid for 12 months

Must match the Display Name in your app manifest

If the app connects to internet, must have a Privacy Policy

Publish first app and then associate the second to it

Approval takes anywhere from 0.5 days to a week

Page 16: An Introduction to Universal Windows Apps

Resources

Get started with Universal Windows Apps:

http://bit.ly/1L45n62

http://bit.ly/1MrKx3Q

http://bit.ly/1u033XM

Page 17: An Introduction to Universal Windows Apps

Summary

Please fill out your surveys!

Title: An Introduction to Universal Windows Apps

https://joind.in/talk/view/13288

Contact Details:

@KenCenerelli

[email protected]

kencenerelli.wordpress.com/contact