22
Richard Thomson Principal Architect for Modeling, Daz 3D [email protected] @LegalizeAdulthd LegalizeAdulthood.wordpress.com

Cross Platform Mobile Development with Visual Studio 2015 and C++

Embed Size (px)

Citation preview

Page 1: Cross Platform Mobile Development with Visual Studio 2015 and C++

Richard Thomson

Principal Architect for Modeling, Daz 3D

[email protected]

@LegalizeAdulthd

LegalizeAdulthood.wordpress.com

Page 2: Cross Platform Mobile Development with Visual Studio 2015 and C++

Thanks to our Sponsors!Community Sponsor

Yearly Sponsor

Marquee Sponsor

Page 3: Cross Platform Mobile Development with Visual Studio 2015 and C++

About Me... Meetup organizer:

Utah C++ Programmers (2nd Wednesday)

Salt Lake City Software Craftsmanship (1st Thursday)

3D Modelers (3rd Tuesday)

C++ language track on exercism.io

Polyglot developer Currently: C++, JavaScript/NodeJS

Previously: C#, JavaScript/NodeJS, Python, Java

Distantly: C, Perl, FORTRAN, LISP, FORTH, Assembly, TECO

Different languages have their strengths

Leverage strengths where appropriate

Page 4: Cross Platform Mobile Development with Visual Studio 2015 and C++

Why C++ for Mobile? Write once, run everywhere

Seriously!

Modern C++ is more familiar than you think

Come to "Modern C++", 3:40 pm, Room 5130 for more

Page 5: Cross Platform Mobile Development with Visual Studio 2015 and C++

No, really. Why C++ for Mobile? Rich variety of abstraction mechanisms

Directly express concepts in code

Execution model maps directly to the machine

Wisely use precious battery life

Deterministic resource allocation

Hold onto resources only for as long as you need them and no longer

No garbage collection

Responsive UI, even when chewing on lots of data

Page 6: Cross Platform Mobile Development with Visual Studio 2015 and C++

Case Study: DropBox Started with platform specific apps

Write everything twice!

Debug everything twice!

Ship everything twice! (and not at the same time)

Switched to MVVM architecture View: Thin platform-specific UI layer (Java/ObjC)

Thin platform-specific services layer (Java/ObjC)

Model, ViewModel: C++

Share business logic and UI logic between platforms

Write almost everything once

Page 7: Cross Platform Mobile Development with Visual Studio 2015 and C++

DropBox Deep Dive on YouTube CppCon 2014: T. Grue & S. Kabbes "From the DropBox

Trenches: A Deep Dive into 2 Cross-Platform Mobile Apps Written in C++"

CppCon 2014: Alex Allain & Andrew Twyman"Practical Cross-Platform Mobile C++ Development"

CppCon 2015: Jacob Potter & Andrew Twyman“Bridging Languages Cross-Platform: DjinniImplementation Techniques"

Page 8: Cross Platform Mobile Development with Visual Studio 2015 and C++

Why Visual Studio? Single IDE for all platforms

Platform-specific IntelliSense:

code completion

code navigation

Single debugger experience

Fast, full-featured Android emulator

Networked connection to Mac host for iOS debugging

Page 9: Cross Platform Mobile Development with Visual Studio 2015 and C++

Android Development Features Supported Versions

4.4 "KitKat", API Level 19

5.0 "Lollipop", API Level 21

Emulator features include

OpenGL ES 2.0

Multi-touch gestures

Advanced camera simulation

WiFi network simulation

Debug directly from VS

Integrated LogCat viewer

Debugger visualizations

Externally built native activity apps

Can attach to running APKs

Stripped debugging to reduce deployment size

Deploy, Debug directly from VS to emulator or device

Page 10: Cross Platform Mobile Development with Visual Studio 2015 and C++

iOS Development Features Supports versions 6, 7, and 8

Debug directly from Visual Studio

Need a connected Mac to deploy and debug on devices only (no emulator)

Page 11: Cross Platform Mobile Development with Visual Studio 2015 and C++

Universal Windows Platform Can also do Universal Windows Platform applications

...but not the subject of this talk :)

Page 12: Cross Platform Mobile Development with Visual Studio 2015 and C++

Installation

Page 13: Cross Platform Mobile Development with Visual Studio 2015 and C++

Android Project Templates

Page 14: Cross Platform Mobile Development with Visual Studio 2015 and C++

Android/iOSOpenGL ES App

Page 15: Cross Platform Mobile Development with Visual Studio 2015 and C++

Android Emulator

Page 16: Cross Platform Mobile Development with Visual Studio 2015 and C++

Launching the Emulator

Page 17: Cross Platform Mobile Development with Visual Studio 2015 and C++

Selecting a Device

Page 18: Cross Platform Mobile Development with Visual Studio 2015 and C++
Page 19: Cross Platform Mobile Development with Visual Studio 2015 and C++

Android Debugger Demo

Page 20: Cross Platform Mobile Development with Visual Studio 2015 and C++

iOS Project Templates

Page 21: Cross Platform Mobile Development with Visual Studio 2015 and C++

iOS Import from XCode

Page 22: Cross Platform Mobile Development with Visual Studio 2015 and C++

iOS Building and Debugging Configure Mac pair machine in Tools / Options

Used for building iOS application

Xcode build output is shown in VS output pane

Debugging is done remotely via gdb

Displayed locally in VS as if you were debugging on Windows

Can issue commands directly to gdb if desired