30
Developing Cross- Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada [email protected]

Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada [email protected]

Embed Size (px)

Citation preview

Page 1: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

Developing Cross-Platform Applications

with Visual Studio 2015Sergii BaidachnyiPrincipal Technical EvangelistMicrosoft [email protected]

Page 2: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

App Development Strategies

Limited access to device capabilities Web performanceDevice-independentEasier management

Web technologies

Full access to device capabilitiesNative performanceHighly customized per device

Native platform technologies

Page 3: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

Developer tools

HTMLBrowser-based applicationsVisual Studio tools forApache Cordova

Visual C++ for cross-platWin32C++

Desktop apps – WPFUniversal Windows Apps

.NET

Rich experiences Breadth of devices

Page 4: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

Visual Studio 2015

Page 5: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

Xamarin

Page 6: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

.NET and XamarinShare app logic across platforms• Native apps for Windows, iOS and

Android devices using .NET

• Most productive and powerful platform for creating native applications

• Maximize code reuse with Universal Projects & Portable Class Libraries

100% APIs exposed• Everything you can do in xCode or ADT

you can do with Visual Studio

z

C# + XIB C# + AXML C# + XAML

Native UI Native UI Native UI

Shared client app C# logic

Page 7: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

Windows APIs

Microsoft.Phone Microsoft.Networking Windows.Storage Windows.Foundation Microsoft.Devices

System.Data System.Windows System.Numerics System.Core System.ServiceModel

System.Net System System.IO System.Linq System.Xml

Page 8: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

iOS – 100% API Coverage

MapKit UIKit iBeacon CoreGraphics CoreMotion

System.Data System.Windows System.Numerics System.Core System.ServiceModel

System.Net System System.IO System.Linq System.Xml

Page 9: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

Android – 100% API Coverage

Text-to-speech ActionBar Printing Framework Renderscript NFC

System.Data System.Windows System.Numerics System.Core System.ServiceModel

System.Net System System.IO System.Linq System.Xml

Page 10: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

Anything you can do in Objective-C, Swift, or Javacan be done in C# and Visual Studio with Xamarin.

Page 11: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

Create UI with drag and drop simplicity

Target multiple screen sizes, resolutions, and OS platform and versions

Layouts saved in native resource formats

World’s best Android designer available in Visual Studio

UI design iOS app designer in Visual Studio

Android app designer in Visual Studio

Page 12: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

Native compilation, native performance

Xamarin.iOS does full Ahead Of Time (AOT) compilation to produce an ARM binary suitable for Apple’s App Store

Xamarin.Android takes advantage of Just In Time (JIT) compilation on the Android device

Page 13: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

Xamarin + Xamarin.Forms

Traditional Xamarin Approach With Xamarin.Forms:More code-sharing, all native

iOS C# UI

Windows C# UIAndroid C# UI

Shared C# Backend

Shared UI Code

Shared C# Backend

Page 14: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

Apache Cordova

Page 15: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

What is Cordova?Native Wrapper

<webview>Your JavaScript

App

• Open source framework• Hosted webview in iOS and Android

platforms, WWAHost in Windows platform• Single, shared HTML, JavaScript, and CSS

codebase deployed to all targets

Page 16: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

What is Cordova?Native Wrapper

<webview>Your JavaScript

App

Cordova Plugin JS API

• Open source framework• Hosted webview in iOS and Android

platforms, WWAHost in Windows platform• Single, shared HTML, JavaScript, and CSS

codebase deployed to all targets• Plugins provide a common JavaScript API

to access device capabilities

Page 17: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

How does Cordova work?

Cordova Project

• HTML, CSS, JS• Assets• Platform code• Plugin code• Configuration

Visual Studio Project• HTML, CSS, JS, assets• Windows-specific runtime• Windows-specific plugin code• Windows-specific configuration

XCode Project• HTML, CSS, JS, assets• iOS-specific runtime• iOS-specific plugin code• iOS-specific configuration

Android Project• HTML, CSS, JS, assets• Android-specific runtime• Android-specific plugin code• Android-specific configuration

Create Cordova Project

Build Cordova Project

Native Windows App

Native iOS App

Native Android App

Page 18: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

• Productivity of Visual Studio for hybrid apps

• Scale to complex Enterprise apps through optional TypeScript support

• End-to-end development workflow included for Windows, iOS and Android

• Flexibility to use any JavaScript framework

Tools forApache Cordova

Hybrid-HTML apps

Cordova tooling in Visual Studio

• Natural path for web developers targeting devices Black Box

CSS | HTMLJavaScript | TypeScript

Page 19: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

Cross-Platform in C++

Page 20: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

Cross-platform mobile apps in C++

Easy installation

One C++ IDE for cross-platform

dev

Share and reuse cross-

platform code

State of the Art code-editing

features

Powerful debugging

experience

Fast emulation

Page 21: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

iOS AndroidWindows

C++ the common denominator

C#, CX ObjC, Swift Java----------

C++----------

C++----------

C++

Benefits• Full native experience• Total access to the device as provided

by the SDK• Code Reuse• Performance• Security

Page 22: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

C++ the common denominator

.ipa.apk.appx

.appx .apk .ipaC#, C++/Cx Java

Dex / ARTObjC Swift

Dynamic Link Library (.dll)Static Library (.lib)

Dynamic shared library (.so)Static library (.a)

Static library (.a)

Shared C++ backend is compiled as:

XAMLCxC#

PinvokeC++ Wrapper

Java/C++ JNI Wrappers

ObjC Wrapper

XMLJava

Cocoa Touch

Shared C++ BackendDropBox

Page 23: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

Compilers Visual C++ Compiler GCCClang/LLVM Clang/LLVM

Build Engine MSBuild, Nmake NDK Build, Make files, Gradle, Ant Xcode Build

IDE(s) Visual Studio Eclipse CDT Xcode

Host Platform Windows 8/8.1/10 MacOS X, Linux, Windows Mac OS X

Development tools for C++ cross-platform

Page 24: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

Challenges with C++ cross-platform mobile

• Multiple installation experiences

• Maintaining multiple build tools and build systems

• Debugging experience is not ideal

• Multiple C++ IDE(s)

Page 25: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

• Easy installation

• One C++ IDE for your cross-platform needs

• Share and reuse cross-platform code

• State of the Art code-editing features

• Powerful debugging experience

• Fast emulation

Visual Studio 2015 Visual Studio 2015

Page 26: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

Introducing!, Visual C++ 2015 (iOS)

• Develop iOS applications using Visual C++

• Easily edit, build and debug your iOS code

• Share and reuse your cross-platform code

• Productivity of Visual Studio now available for iOS

Page 27: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

Xamarin and Visual C++ 2015

Xamarin Android native (C/C++) users will now be able to:

• Build Android native Libraries (.so and .a) using Visual Studio

• Debug their Android native using a powerful debugging experience

Page 28: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

Unity

Page 29: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

Its FreeUse Visual Studio to edit & debug codeIntegrates VS with UnityProvides

Shader syntax highlightingCode templatesIntellisenseFull debugging support

Visual Studio Tools for Unity

VSTU

Page 30: Developing Cross-Platform Applications with Visual Studio 2015 Sergii Baidachnyi Principal Technical Evangelist Microsoft Canada sbaydach@Microsoft.com

Visual Studio Graphics DebuggerNow with full Unity supportSupports

Single or multi frame captureFrame level debuggingMemory profiling

Visual Studio 2013 CTP5 and above

Diagnostics