the great mobile debate: native vs. hybrid app development

75
Building Mobile Cross-Platform Apps with HTML5, jQuery Mobile & PhoneGap Nick Landry Microsoft Senior Technical Evangelist Nokia Developer Ambassador [email protected] www.AgeofMobility.com @ActiveNick

Upload: nick-landry

Post on 06-May-2015

3.571 views

Category:

Technology


3 download

DESCRIPTION

It’s not easy being a mobile developer. iOS and Android dominate the market, Windows Phone is climbing into third place, and we’re not really sure if BlackBerry still matters. Do you focus on one platform or many? What size of the mobile population do you really want to reach? Each mobile platform comes with its own programming languages, SDKs, IDEs and application lifecycle & architecture. Are we really expected to learn all of this? Isn’t HTML5 supposed to be the Silver Bullet so we can finally write apps once and run them everywhere? This session will demystify all these questions, walking you through the modern mobile ecosystem, and explore your options as a developer. We’ll review the native story on each major platform, discuss the pros & cons of both mobile native and web development, cover some of the cross-platform solutions available to developers, and explore best practices and guidelines to insure a successful mobile strategy. Don’t just blindly pick a side or assume that “one size fits all”, this session covers one of the most hotly contested debates in modern IT. Come join us and be a part of the conversation.

TRANSCRIPT

Page 1: The Great Mobile Debate: Native vs. Hybrid App Development

Building Mobile

Cross-Platform Apps

with HTML5, jQuery

Mobile & PhoneGap

Nick LandryMicrosoft Senior Technical Evangelist

Nokia Developer Ambassador

[email protected]

www.AgeofMobility.com

@ActiveNick

Page 2: The Great Mobile Debate: Native vs. Hybrid App Development

Who is ActiveNick?• Senior Technical Evangelist – Microsoft

• Nokia Developer Ambassador and Champion

• Former Microsoft MVP – 2005-2014: Windows Phone Development

– Mobile Publisher – Big Bald Apps: http://www.bigbaldapps.com

• Speaker. Blogger. Author. Tweeter. Gamer

• 20+ Years of Professional Experience

• Specialties:

– Cross-Platform Mobile Development

– Location Intelligence & Geospatial Systems

– Data Visualization, HPC, Cloud

– Mobile Game Development

• Blog: www.AgeofMobility.com

• Twitter: @ActiveNick

2005-2014

Page 3: The Great Mobile Debate: Native vs. Hybrid App Development

Agenda• Review of Modern Mobile Platforms

• Different Approaches for Multi/Cross-Platform Development

– Native Mobile Development

– Mobile “Hybrid” Development

– Other Cross-Platform Options

• Fight! Pros & Cons of Each

• Recommendations & Guidelines

• Join in & Participate

Page 4: The Great Mobile Debate: Native vs. Hybrid App Development

Why Mobile Development Matters• Humans are lazy & reactive

• Users are more mobile than ever

• Miniaturization and the all-in-one device

• Smartphones & tablets: From luxury to commodity

• From a “Connected World” to a “Social World”

• Smartphones and tablets overtaking PCs & laptops

• The Enterprise and BYOD

• New monetization platforms

• Reaching millions of users & expanding your audience to developing markets

• Mobile apps are the new resume

Page 5: The Great Mobile Debate: Native vs. Hybrid App Development

Really?

What is a Mobile Developer?

Page 6: The Great Mobile Debate: Native vs. Hybrid App Development

Mobile Development: The Reality

Page 7: The Great Mobile Debate: Native vs. Hybrid App Development

Mobile Platform Options

Page 8: The Great Mobile Debate: Native vs. Hybrid App Development

Will Mobile Development Make Me Rich!

Page 9: The Great Mobile Debate: Native vs. Hybrid App Development

What’s

Driving

Mobile?

Page 10: The Great Mobile Debate: Native vs. Hybrid App Development

Is Market Share the Whole Story?

Page 11: The Great Mobile Debate: Native vs. Hybrid App Development

$

Top Row Source: Microsoft, as of 1/31/14Year over Year (YoY) Source: Microsoft, 1/31/13 – 1/31/14

Quarter over Quarter (QoQ) Source: Microsoft, Q3 vs Q4 2014

Recent Highlights

Windows App Ecosystem Growth

Page 12: The Great Mobile Debate: Native vs. Hybrid App Development

What is a Mobile Developer?Mobile Web / Hybrid Dev

Web

View

Web

View

Web

View

• Objective-C

• Xcode, AppCodeiOS

• Java

• Eclipse, IntelliJAndroid

• C#, VB, F#, etc.

• Visual StudioWindows

• C#

• Xamarin Studio

Xamarin

.iOS

(Mono)

• C#

• Xamarin Studio

Xamarin

.Android

(Mono)

• C#, VB, F#, etc.

• Visual Studio

Windows

(.NET,

WinRT)

Native Mobile Platforms Native Cross-Platform Dev

HTML5

JavaScript

HTML5

JavaScript

HTML5

JavaScript

Native API

to iOS

(PhoneGap)

Native API

to Android

(PhoneGap)

Native API

to Windows

(PhoneGap)

Page 13: The Great Mobile Debate: Native vs. Hybrid App Development

i.e. How to compete with 1,000,000 apps

iOS Development for iPhone & iPad

Page 14: The Great Mobile Debate: Native vs. Hybrid App Development

Your first app

“The quality of app store apps have become very high. To

reach those standards requires a lot of investment in time

and resources, which is really difficult for a solo developer.”

Konstantinos Kontos

Software Designer - Lead iOS / OS X Engineer

400,000 iOS apps were never downloaded (~57%)

Page 15: The Great Mobile Debate: Native vs. Hybrid App Development

Getting Started with Native iOS Development

Get a Mac. iOS device

recommended too

• 2.5GHz Intel Core i5 Mac

Mini from $599 (new)

• 11-inch Intel Core i5 64GB

MacBook Air from $999

(new)

• Look for eBay Deals

Install Xcode

• Free download in the Mac

App Store

• Register an account at

developer.apple.com

• $99 / year to deploy to

actual devices & publish to

the App Store

Install Xamarin.iOS

• Aka “MonoTouch”

• Yes, you still need a Mac to

build iOS apps

• Free Starter Edition at

Xamarin.com

• $299 for Indie Edition: no

size limit + components

Install Other Tools

• UI Controls

• SDKs & Frameworks

• Dev Tools & IDEs

• Prototyping Tools

• Deployment Tools

• Start Learning!

Page 16: The Great Mobile Debate: Native vs. Hybrid App Development

Getting Started: .NET iOSMICROSOFT .NET DEVELOPER APPLE IOS DEVELOPER

Computer Any Windows PC/laptop Mac

Dev Operating System Windows 8.x Mac OS X

Official Resources MSDN Apple Developer Center

Development IDE Visual Studio Xcode

Development Languages C#, VB.NET, F#, etc. Objective-C

Primary SDK .NET FrameworkWP SDK – WinRT SDK

iOS SDK

Code Compilation Managed Code Native Code

Runtime CLR / WinRT No*

SDK Libraries Assemblies Frameworks

User Interface XAML Controls Cocoa Touch Controls

Operating System Targets Windows 8, Windows Phone iOS

Developer Program $19 per year $99 per year

Target Devices Lots of Diversity Few Options

Page 17: The Great Mobile Debate: Native vs. Hybrid App Development

iOS and the Model View Controller

Page 18: The Great Mobile Debate: Native vs. Hybrid App Development

Android Development

i.e. How to build apps for 12,000+device models

Page 19: The Great Mobile Debate: Native vs. Hybrid App Development

“I was looking to pick the most common Android devices, and then discovered that the top 100 only covered about a third of our users.”

Mike ShaverEngineering Director, Facebook

Page 20: The Great Mobile Debate: Native vs. Hybrid App Development

Development for the Android Ecosystem

Page 21: The Great Mobile Debate: Native vs. Hybrid App Development

Android UI Design

Dealing with Countless Screen Sizes & Resolutions

Page 22: The Great Mobile Debate: Native vs. Hybrid App Development

Android UI Fragments

Page 23: The Great Mobile Debate: Native vs. Hybrid App Development

Android Platform Fragmentation

http://opensignal.com/reports/fragmentation.php

Page 24: The Great Mobile Debate: Native vs. Hybrid App Development

Windows & Windows Phone Development

Rooting for the underdog

Page 25: The Great Mobile Debate: Native vs. Hybrid App Development
Page 26: The Great Mobile Debate: Native vs. Hybrid App Development

Windows Phone in Numbers

240K 91% 10%

24 13

Page 27: The Great Mobile Debate: Native vs. Hybrid App Development

It’s important to design for the platform differences as well as similarities

Windows: Some Key Differences

Screen SizeWindows Phone

800x480, 1280x720, 1280x768Portrait, Landscape

Windows

1366x768, 1920x1080, etc.Portrait, Landscape, Snapped

ControlsWindows Phone

Panorama, Pivot, ListPickerLongListSelector

Windows

GridView, ListView, Semantic Zoom, FlipView

LifecycleWindows Phone

Launched from start/apps list.Tombstones apps

Windows

Resumes existing appsNo tombstoning

PlatformWindows Phone

WinRT-XAML + C#, VB, C++

Silverlight Legacy API

Windows

WinRT Core:

• XAML + C#, VB, C++

• HTML + JavaScript (WinJS)

Both run C++ & D3D games

Page 28: The Great Mobile Debate: Native vs. Hybrid App Development

One Windows for App Developers

Page 29: The Great Mobile Debate: Native vs. Hybrid App Development

Windows developer platform

| |

Windows Phone Only

Windows Only

Page 30: The Great Mobile Debate: Native vs. Hybrid App Development

Architecting

Mobile Apps

Page 31: The Great Mobile Debate: Native vs. Hybrid App Development

Silo

Approach:

Build the

Same

Apps Multiple

Times

Page 32: The Great Mobile Debate: Native vs. Hybrid App Development

Write Once,

Run Anywhere

Approach

Lowest

Common

Denominator

Browser

Fragmentation

• App Generation.

• Web Browser in a

Native Wrapper +

PhoneGap APIs.

Page 33: The Great Mobile Debate: Native vs. Hybrid App Development

Mobile Web / Hybrid Web Apps

PhoneGap and its Derivatives

Page 34: The Great Mobile Debate: Native vs. Hybrid App Development

What is a Mobile Hybrid App?

Native WP Shell

Embedded Internet

Explorer Browser

Control

Native iOS Shell

Embedded Safari

Browser Control

Native Platform API Native Platform API

MOBILE WEB

APP

=========

HTML5

(JavaScript, CSS3)

Responsive Design

JavaScript

Frameworks

PhoneGap APIJavaScript API Exposing

Native Platform Services

MOBILE WEB

APP

=========HTML5

(JavaScript, CSS3)

Responsive Design

JavaScript Frameworks

PhoneGap APIJavaScript API Exposing

Native Platform Services

Page 35: The Great Mobile Debate: Native vs. Hybrid App Development

Cross-Platform Mobile Apps

Page 36: The Great Mobile Debate: Native vs. Hybrid App Development

PhoneGap, by any other name…

Page 37: The Great Mobile Debate: Native vs. Hybrid App Development

PhoneGap Project Structure• config.xml

– Application attributes for PhoneGap Build

• index.html– Web app entry point

– Included tags for phonegap.js, CSS, etc.

• index.css (in css folder)– Basic CSS styles

• index.js (in js folder)– With deviceReady handler

Page 38: The Great Mobile Debate: Native vs. Hybrid App Development

People Expect Great Experiences

Page 39: The Great Mobile Debate: Native vs. Hybrid App Development

Facebook HTML

Page 40: The Great Mobile Debate: Native vs. Hybrid App Development

Facebook Native

Page 41: The Great Mobile Debate: Native vs. Hybrid App Development

Cordova, PhoneGap, AppBuilder, Nomad…

Pros

• Write once in HTML5 & JavaScript, deploy to

multiple device platforms

• Code reuse

• Reuse existing Web expertise

• Lower development costs when targeting 2+

platforms

• Faster time to market on 2+ platforms

• Simplified deployment with cloud builds

• Modular architecture with plugins

• JQM adaptive rendering to emulate the device’s

native UI

• Telerik AppBuilder and Red Gate Nomad brings

Cordova to Visual Studio + build in the cloud

Cons

• Single UI = Generic design that doesn’t feel at

home on multiple device platforms

• Browser discrepancies

• Inferior tooling

• Learn new JavaScript frameworks: jQuery UI,

JQM, Knockout, Twitter Bootstrap, etc.

• Performance considerations

• Limited to device APIs exposed by PhoneGap

vs. native platform APIs

• Reactionary to native platform changes

• High-end & 3D graphics limited / impossible

• Vendor lock-in

Page 42: The Great Mobile Debate: Native vs. Hybrid App Development

Cross-Platform Design?

Page 43: The Great Mobile Debate: Native vs. Hybrid App Development

Cross-Platform App Dev with Xamarin

10 years later, Mono is alive & kickin’!

Page 44: The Great Mobile Debate: Native vs. Hybrid App Development

Xamarin

Approach

Native with

Code Sharing

Business Logic

Cloud Integration

Database Access

Page 45: The Great Mobile Debate: Native vs. Hybrid App Development

How Does Xamarin Run C# on iOS or Android?

Page 46: The Great Mobile Debate: Native vs. Hybrid App Development

Xamarin HistoryOver a Decade of Enterprise Production Use

2000

Ximian

Founded

2001

Mono

Started

2003

Ximian

Acquired

by Novell

2009

First iOS

product (now

Xamarin.iOS)

launches

2011

Xamarin

Founded

First

Release of

Xamarin.Android

2012

First

release of

Xamarin.Mac

Launch

Partner

Program

2013

Xamarin 2.0

Component

Store

Evolve 2013

Xamarin Test

Cloud

Microsoft

Partnership

Reach 200,000

Developer

Mark

500,000+

Developers

100+ Partners

100+ Components

Page 47: The Great Mobile Debate: Native vs. Hybrid App Development

http://scan.xamarin.com

.NET Mobility Scanner

Page 48: The Great Mobile Debate: Native vs. Hybrid App Development

Windows

APIs

Page 49: The Great Mobile Debate: Native vs. Hybrid App Development

iOS

APIs

100%

coverage

Page 50: The Great Mobile Debate: Native vs. Hybrid App Development

Android

APIs

100%

coverage

Page 51: The Great Mobile Debate: Native vs. Hybrid App Development

Xamarin: How much?

Starter Edition

(free)

Indie Edition

($299)

Business

Edition ($999)

Enterprise

Edition ($1899)

Integration with Visual Studio in Business Edition & above

Page 52: The Great Mobile Debate: Native vs. Hybrid App Development

Xamarin.Mac

Xamarin Studio

Xamarin Test Cloud

Component Store

Xamarin.iOS

Xamarin.Android

Xamarin for

Visual Studio

.NET Mobility Scanner

Page 53: The Great Mobile Debate: Native vs. Hybrid App Development

Development Environment

Xamarin Studio

PC or MacVisual Studio Plugin

VS 2010/2012/2013

Page 54: The Great Mobile Debate: Native vs. Hybrid App Development

Xamarin Studio

Page 55: The Great Mobile Debate: Native vs. Hybrid App Development

Visual Studio Integration

Page 56: The Great Mobile Debate: Native vs. Hybrid App Development

Android Designer

Page 57: The Great Mobile Debate: Native vs. Hybrid App Development

iOS Designer

Page 58: The Great Mobile Debate: Native vs. Hybrid App Development

How

Xamarin

Works

C# + .NET Runtime

Native UI

Native Performance

Page 59: The Great Mobile Debate: Native vs. Hybrid App Development

Native Dev: Platform Tools or Xamarin?

Platform Tools (Windows, iOS, Android)

• Default native method to build apps

• Free development tools & SDKs

• Requires learning at least one language &

SDK per platform (C#, Java, Objective-C)

• Design, develop & maintain completely

separate apps for each platform

• More learning resources available

• Books, web sites, blogs, training,

StackOverflow, videos, larger community,

etc.

• iOS: Only option (yet) for GUI design with

Interface Builder

Xamarin / Mono

• Reuse existing C# skills & source code (but

you have to know C#)

• Need to buy an additional tool: extra cost

• Need to learn new tools & techniques

• Still need to learn the specifics of each

platform SDK, app architecture & lifecycle

• Fewer third-party libraries available

• No built-in GUI designer for iOS (yet, in

beta): Use IB in Xcode or code it!

• Offers a better Android designer than

provided by Google for Eclipse

• Vendor lock-in / dependency

Page 60: The Great Mobile Debate: Native vs. Hybrid App Development

Which Mobile Approach is the Right One?

Is There a Silver Bullet?

Page 61: The Great Mobile Debate: Native vs. Hybrid App Development

Go Native or Go Home

If you want to chase that “Angry Birds” money…

Page 62: The Great Mobile Debate: Native vs. Hybrid App Development

Mobile Strategy Considerations

Audience

• General Consumer

Market

• Niche Consumer

Market

• Enterprise Users

• BYOD

Objectives

• Marketing “Checklist”

Apps

• Brand “Reach” Apps

• Weekend Warrior Apps

• Apps for Profit

• Mobile Revolution

Apps

Other Considerations

• Mobile Population

Coverage Target &

Desired Reach

• Expertise

• Resources

• Timeframe

Page 63: The Great Mobile Debate: Native vs. Hybrid App Development

There is no silver bullet, no “one size fits all”, when choosing a cross-platform mobile strategy

Native Apps and Hybrid Apps both have their place

Each mobile project should be evaluated separately Audience, Goals, Reach, Expertise, Resources

Always create a unique UI specific to the platform

Summary

Page 64: The Great Mobile Debate: Native vs. Hybrid App Development

www.AgeofMobility.com

developer.apple.com/videos/ios

developer.apple.com/wwdc/videos

www.pluralsight.com/training/Courses#ios

http://iosdevweekly.com

www.infragistics.com/community/blogs/stevez

www.infragistics.com/community/blogs/torrey-betts

twitter.com/ActiveNick/ios-dev-bloggers

iOS Technical Resources

Page 65: The Great Mobile Debate: Native vs. Hybrid App Development

Recommended iOS Books

iOS Programming for .NET Developers

(Josh Smith)

http://iosfordotnetdevs.comProgramming iOS 7, 4th Edition

(Neuburg, O’Reilly)

http://amzn.to/1el9Z7L

iOS Programming: The Big Nerd Ranch Guide

4th Edition(Conway, Hillegass, Keur)

http://amzn.to/1dIM999

Objective-C Programming: The Big Nerd Ranch Guide

2nd Edition (Hillegass, Ward)

http://amzn.to/1kHJQaB

Page 66: The Great Mobile Debate: Native vs. Hybrid App Development

Free iBooks

These iBooks are not very recent, dating back to 2010 and iOS version 4

But free is free!

Use them as a starting point but make sure to stay current with references on programming for iOS 5 and 6

Additional iOS Programming books are available for free from Apple via the iBooks Store on

your iOS device, including Objective C, Cocoa Fundamentals, iOS, OS X, Deployment &

more.

Available on iPad and iPhone

Page 67: The Great Mobile Debate: Native vs. Hybrid App Development

Getting Started with Windows PhoneGet Ready to Become a Windows Phone Developer

Download the SDK at dev.windowsphone.com

Explore the Microsoft samples and start building apps in Visual Studio

Learn More About Windows Phone Dev via Official Microsoft Videos

Windows Phone 8 Jump Start Training: http://bit.ly/wp8jump

Windows Phone 8 Dev for Absolute Beginners: http://bit.ly/wp8devAB

Check Out Additional Learning Resources

Pluralsight WP Training: www.pluralsight.com/training/Courses#windows-phone

Nokia Developer: www.developer.nokia.com

Download Additional Resources & Become an Expert

Download the Windows Phone Toolkit: phone.codeplex.com

Nokia Developer Offers: http://bit.ly/nokiadevoffers

68

1

2

3

4

Page 68: The Great Mobile Debate: Native vs. Hybrid App Development

http://channel9.msdn.com/Events/Build/2014/

Page 69: The Great Mobile Debate: Native vs. Hybrid App Development

dev.windowsphone.com

http://bit.ly/wp8jump

http://bit.ly/wp8devAB

blogs.windows.com/windows_phone/b/wpdev

blogs.windows.com/windows_phone/b/windowsphone

http://developer.nokia.com

http://bit.ly/godvlup

http://conversations.nokia.com

http://apps.windowsstore.com

www.AgeofMobility.com

http://flip.it/95YFG

www.geekchamp.com

www.wpcentral.com

Windows Phone Resources

Page 70: The Great Mobile Debate: Native vs. Hybrid App Development

Recommended JQM & PhoneGap Books

jQuery, jQuery UI, and jQuery Mobile: Recipes and Examples

(de Jonge, Addison-Wesley)

http://amzn.to/1eB5KHE

20 Recipes for Programming PhoneGap: Cross-Platform Mobile

Development for Android and iPhone (Munro, O’Reilly)

http://amzn.to/18SohJC

jQuery Mobile: Up and Running

(Firtman, O’Reilly)

http://amzn.to/15Olkce

jQuery Mobile

(Reid, O’Reilly)

http://amzn.to/1aAcd6K

Page 71: The Great Mobile Debate: Native vs. Hybrid App Development

http://phonegap.com

http://nodejs.org

http://jquerymobile.com/resources

www.pluralsight.com/training/Courses/Find?searchTerm=phonegap

www.sublimetext.com

http://jsFiddle.net

http://JSBin.com

http://codiqa.com

www.jetbrains.com/webstorm

Technical Resources: PhoneGap & Web

Page 72: The Great Mobile Debate: Native vs. Hybrid App Development

PhoneGap Articles and Posts

• PhoneGap 3.0 – Stuff You Should Know

– http://devgirl.org/2013/09/05/phonegap-3-0-stuff-you-should-know

• PhoneGap 3 for Dummies, Part 1: Setup & a first example

– http://neophob.com/2013/08/phonegap-3-for-dummies-part-1-

setup-and-a-first-example

• PhoneGap and Cordova with iOS 7

– http://coenraets.org/blog/2013/09/phonegap-and-cordova-with-ios-7

Page 73: The Great Mobile Debate: Native vs. Hybrid App Development

Recommended Android & Xamarin Books

Xamarin Mobile Application Development for iOS

(Paul Johnson)

http://amzn.to/1bGBD2o

Mobile Development with C#: Building Native iOS, Android,

and Windows Phone Applications (Greg Shackles)

http://amzn.to/1bdWYgR

Android Programming: The Big Nerd Ranch Guide

(Bill Phillips, Brian Hardy)

http://amzn.to/1k7jeuK

Programming Android: Java Programming for the New

Generation of Mobile Devices (Mednieks, Dornin, et al.)

http://amzn.to/1bdHA4W

Page 74: The Great Mobile Debate: Native vs. Hybrid App Development

http://xamarin.com/download

http://docs.xamarin.com

http://xamarin.com/evolve/2013

http://blog.xamarin.com

http://weblogs.asp.net/wallym

http://www.gregshackles.com

www.AgeofMobility.com

Page 75: The Great Mobile Debate: Native vs. Hybrid App Development

Thank You!Slides will be posted on my Slideshare account.

Please share your comments. Your feedback is important and appreciated.

Slideshare: www.slideshare.net/ActiveNick

Blog: www.AgeofMobility.com

Twitter: @ActiveNick

Mobile Apps: www.bigbaldapps.com

LinkedIn: www.linkedin.com/in/activenick

Website: www.AgeofMobility.com

Email: [email protected]