windows universal apps

22
WINDOWS UNIVERSAL APPS JAMES QUICK MICROSOFT TECHNICAL EVANGELIST @JQUICKWIT [email protected] MEETUP: MIAMI FT-LAUDERDALE WINDOWS APP DEVELOPERS HTTP://BLOGS.MSDN.COM/QUICK_THOUGHTS/

Upload: james-quick

Post on 25-Jan-2015

488 views

Category:

Technology


1 download

DESCRIPTION

Gives an introduction to the new Universal App template in Visual Studio to build both Windows 8 and Windows Phone apps with minimal code.

TRANSCRIPT

Page 1: Windows Universal Apps

WINDOWS UNIVERSAL APPS

JAMES QUICK

MICROSOFT TECHNICAL EVANGELIST

@JQUICKWIT

[email protected]

MEETUP: MIAMI FT-LAUDERDALE WINDOWS APP DEVELOPERS

HTTP://BLOGS.MSDN.COM/QUICK_THOUGHTS/

Page 2: Windows Universal Apps

WHAT’S NEW FROM BUILD

• Windows Phone and Windows 8 Stores get even closer

• Unified windows apps

• Windows 8.1 update 1

• Windows Phone 8.1

• Currently in developer preview

• WINDOWS UNIVERSAL APPS

• Visual Studio Update

Page 3: Windows Universal Apps

WINDOWS UNIVERSAL APPS

• Build app for both Windows and Windows Phone at the same time

• 3 projects- Windows, Windows Phone, Shared

• Talk more soon!

Page 4: Windows Universal Apps

UNIFIED WINDOWS APPS

• Develop W8 and WP8 app with Universal Apps

• Choose to let user download an app once, and get it on both platforms

• Free or paid

• New Unified Windows Apps symbol

Page 5: Windows Universal Apps

WINDOWS PHONE 8.1

• Save apps to memory card

• Automatic updates

• Cortana

• Notification center

• Swype text

• Updated store UI

Page 6: Windows Universal Apps

WINDOWS PHONE 8.1 FROM DEV PERSPECTIVE

• Faster approval times

• Days to hours

• Automatic updates

• Discoverability of apps

• Save apps to memory card

• New APIs (including Cortana)

Page 7: Windows Universal Apps

WINDOWS 8.1 UPDATE 1

• Pin modern apps to the task bar

• Minimize and close buttons for modern apps

• Store app is prepinned to task bar

• Easier to find apps now

• Remodeled Store UI

• Discoverability of apps

Page 8: Windows Universal Apps

FOR DEVS

• Faster approval times after submitting apps

• Universal App template to build for both platforms

• Merged both of the store agreements

• Optimized pubcenter dashboard for ads

• Allow developers to respond to user reviews (in beta)

• Charge per app or per device

Page 9: Windows Universal Apps

UNIVERSAL APPS- GETTING STARTED

• Download vs 2013 update 2 RC

• http://bit.ly/VS2013Update2

• Includes phone 8.1 emulators

• Install Windows Phone 8.1 OS Preview

• Good for testing on physical device

Page 10: Windows Universal Apps

UNIVERSAL APP TEMPALTES

• Blank

• Pretty straight forward

• Hub

• Similar to grid template in Windows 8

• Displayed as pivot control in Windows Phone

Page 11: Windows Universal Apps

UNIVERSAL APPS SETUP

• Windows Store Project contains XAML pages and code that target Windows

• Windows Phone Project contains XAML pages and code that target Windows Phone

• Shared Project is a container for code that runs on both platforms

• Automatically included in both Windows and Windows Phone Projects

• No build output

Page 12: Windows Universal Apps
Page 13: Windows Universal Apps

LETS TAKE A LOOK…

Page 14: Windows Universal Apps

DEBUG TARGET

• Dropdown menu to choose debug target

• Switch between targeting Windows 8 and Windows Phone

• Run both in emulators or on a device

Page 15: Windows Universal Apps

ADD FILES TO SHARED FOLDER

• Add

• Movie class

• Styles

• Move

• Mainpage.xaml

• App.xaml is already in shared folder

• By default with universal app template

• Can be moved to shared folder when adding support for universal

Page 16: Windows Universal Apps

CONTEXT SWITCHER

• If you use an API in shared code that’s not supported on both platforms, an error message will identify this API when you build the project. You don't have to build the project, however, to confirm that you’re using cross-platform APIs.

Page 17: Windows Universal Apps

SAME FILE, BUT PLATFORM SPECIFIC APIS??

Page 18: Windows Universal Apps

#IFDEF DIRECTIVE

• constants WINDOWS_APP and WINDOWS_PHONE_APP are conveniently predefined for you

• Have platform specific code for each

• If windows app, do this

• If windows phone app, do this

Page 19: Windows Universal Apps

#IFDEF DIRECTIVE

• #if WINDOWS_APP if (!rootFrame.Navigate(typeof(HubPage)))#endif#if WINDOWS_PHONE_APP if (!rootFrame.Navigate(typeof(WindowsPhoneStartPage)))#endif { throw new Exception("Failed to create initial page"); }

Page 20: Windows Universal Apps

NUGET PACKAGES

• Must be added to both Windows and Windows Phone projects if referenced in shared folder

• “if your Windows Store app contained an assembly reference for a third-party library, and you move the associated code into the Shared folder, then you also have to reference the third-party library in the Windows Phone project”

Page 21: Windows Universal Apps

EXAMPLE WITH ROTTEN TOMATOES API

Page 22: Windows Universal Apps

ADD SUPPORT FOR MISSING PLATFORM

• Example- add Windows Phone 8.1 to existing Windows 8.1 project

• Let’s take a look at our simple movie example

• Start with just windows 8.1