Build for both: Windows and Windows Phone

Slides:



Advertisements
Similar presentations
Session 1.
Advertisements

demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
TechEd /11/2018 6:16 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Windows Azure Jeffrey Ferman Program Manager 3-006
WebView: Bringing the web to your app
TechEd /26/2018 3:42 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Build /4/2018 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Windows Azure Jason Olson, Program Manager 4-142
TechEd /8/ :20 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
How We Do Language Design at Microsoft (C#, Visual Basic, F#)
Design Guidance for Windows Store Line-of-Business Apps
TechEd /14/2018 6:26 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
0 to 60: Developing Apps for Microsoft Office 2013
Building modern web applications with Visual Studio and Web Essentials
Jason Zander Unplugged
Mobile Center and VSTS:​ Better together for your Mobile DevOps
Visual Studio 2013 for web developers
Build /2/ The future of Azure devops: Building and managing cloud applications lifecycle across your teams Bradley Millington Program.
Title of Presentation 12/2/2018 3:48 PM
TechEd /3/2018 8:11 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Microsoft products for non-profits
Brian Keller Sr. Technical Evangelist Microsoft Session Code: DEV310
Sessions about to start – Get your rig on!
TechEd /6/2018 8:16 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
TechEd /9/2018 4:17 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Quality & Performance for XAML Apps
Tech Ed North America /1/2019 2:58 AM Required Slide
TechEd /11/ :21 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
TechEd /11/ :54 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
TechEd /15/2019 8:08 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Tech·Ed North America /17/2019 1:47 AM
Brian Keller Sr. Technical Evangelist Microsoft Session Code: DEV310
Windows Phone: Developer Best Practices and How to Maximize Performance
TechEd /18/ :08 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
TechEd /18/2019 2:43 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Building Metro style apps with XAML with .NET
TechEd /22/2019 9:22 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Build /23/2019 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
TechEd /23/2019 7:16 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Pushing Data to and from the Cloud with SQL Azure Data Sync
Using Windows Runtime and SDK to build Metro style apps
TechEd /4/2019 3:19 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Sayed Ibrahim Hashimi Program Manager Microsoft Corporation
Build /10/2019 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
IE11’s Developer Tools, F12, just got nicer (again)
TechEd /7/2019 1:14 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Silverlight Debugging
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
What's New in Visual Studio & Blend for XAML Developers
Brandon Bray Principal Group Program Manager Microsoft Corporation
TechEd /11/ :25 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
From Start to REST in 60 Minutes (DEV323)
Designing Bots that Fit Your Organization
TechEd /27/2019 5:37 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Jason Zander Unplugged
5/1/2019 3:29 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Шитманов Дархан Қаражанұлы Тарих пәнінің
The complete developer's guide to the SkyDrive API
Build /20/2019 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Title of Presentation 5/24/2019 1:26 PM
Bringing existing managed code into Metro style apps
TechEd /12/ :12 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
TechEd /30/2019 7:18 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
What’s New in the Visual Studio 2013 IDE
TechEd /5/2019 2:08 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
TechEd /21/2019 9:49 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
11/1/2019 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Presentation transcript:

Build for both: Windows and Windows Phone Matt Hidinger Clarity Consulting 2-215

So umm… you’re not with Microsoft? Clarity Consulting Windows Phone Dev MVP

But first… a phone!

Sharing Design for both Develop for both Architecture & patterns Image credit: Jason Emprey

Real-world stocks

Design for both

What do they have in common? Windows Phone C# .NET XAML WinRT Windows Same design language

How do they differ? Form factors, mostly Windows Phone 800x480

Landing pages

GridView Panorama Grouped by section Horizontal scrolling PanoramaItem per section Horizontal and vertical scrolling

Lists of data

GridView LongListSelector Horizontal scrolling Optionally grouped Semantic zoom to quickly navigate Vertical scrolling Optionally grouped Jump list to quickly navigate

App bars

AppBar ApplicationBar Top and Bottom Supports circular buttons And/or any content you want Bottom only Supports circular buttons And/or menu items

Back buttons

On screen On device

My personal favorite

Inspiration is everywhere Design is more than the appearance Tune the experience and use cases for the form factor Pay attention to the details, modern design isn’t lack of design

Develop for both

Sharing an assembly

Portable Class Libraries One Source One Project One Binary Multiple Platforms!

Demo Portable Class Library

Sharing source code

When? XAML Ctrl -C -V Image credit: http://quickmeme.com

Linked files

Linked files Windows Phone Windows Hold Alt and drag a folder to link multiple files at once!

Demo Linked Files

Compiler directives Windows Windows phone #if NETFX_CORE Dispatcher.RunAsync(CoreDispatcherPriority.Normal, myAction); #endif Windows phone #if WINDOWS_PHONE Deployment.Current.Dispatcher.BeginInvoke(myAction); #endif

Demo Compiler Directives

TL;DR: use them both Comparison Sharing an assembly (PCL)  Code remains clean and single purpose Build, test, compile once  Limited API access Can’t reference non-PCL assemblies Won’t work with Express SKUs Sharing source code (linked files)  Full API access on the platform compiling it Can tweak source per platform using #if  Code can become complex due to compiler directives Minor Visual Studio quirks: “This document is already open” TL;DR: use them both

Use your skills, Luke You know C# You know .NET You know and love XAML (right?)

Architecture & patterns

Windows Phone Windows Linked App Startup / Lifecycle Views Controls Converters ViewModels Windows App Startup / Lifecycle Views Controls Converters ViewModels Linked Portable Class Library CoreViewModels Services Models

Demo Building real-world stocks

Summary

What to share? PCL Linked source User Interface ü Models ü Business logic ü Web Services ü Helpers ü Logging ✋ View Models (if it makes sense) ✋ Commands (if it makes sense) Linked source ü Converters ü Commands ✋ Controls (if it makes sense) ✋ View Models (if it makes sense) User Interface ü Static assets ü Design language  XAML: Not right now

Mix and match techniques Architect with sharing in mind Put as much into a PCL as possible Use a platform adapter to Do More in Core Use #if conditions for minor code differences Extension methods can bridge missing APIs Maximize the user experience for each platform Image credit: Daniel E Lee

Beneficial frameworks Portable HttpClient PCLStorage MetroLog MVVM Caliburn.Micro MVVM Light

Try it yourself! Download the full source for this talk in a few days http://bit.ly/BuildRealWorldStocks

Related sessions Story of Nokia Music, from Windows Phone to Windows Store 2-219 – Matthew Cooper – North 134 – 30 minutes from now! Windows Phone Development Best Practices 2-216 – Stefan Wick – North 134 – Friday @ 10:30 AM MVVM In Action – Hulu Case Study 2-205 – Matthias Shapiro – North 134 – Friday @ 12:00 PM

References Daniel Plaisted - Making Portable Libraries Work For You Matthias Shapiro – TechEd 2013, Build It Once For Both Rajen Kishna's Technical Tidbits Doug Holland - Sharing Code, MSDN Magazine @dotMorten – Code Sharing Wizard

Drinks and appetizers provided Sharing code meet-up! Drinks and appetizers provided Join other speakers and Microsoft employees to talk about sharing Today @ 6 PM Microsoft Office 835 Market Street, Suite 700

Thank you! Q&A @MattHidinger

6/3/2018 6:31 AM Required Slide *delete this box when your slide is finalized Your MS Tag will be inserted here during the final scrub. Evaluate this session Scan this QR code to evaluate this session and be automatically entered in a drawing to win a prize! © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.