Top Banner
Totally Build Apps for Free *not really Tony Hillerson • Tack Mobile Mobile+Web DevConf San Francisco January 2015
44
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Totally Build Apps for Free! (not really)

Totally Build Apps for Free*not really

Tony Hillerson • Tack Mobile

Mobile+Web DevConf

San Francisco January 2015

Page 2: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

slideshare.net/thillerson/totally-build-apps-for-free-not-really

Page 3: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

About Me

• Engineering Director, Tack Mobile

• Denver, CO

• Android (since Beta), then iOS (since ~ iOS 2)

• Various Server-side technologies

• Pragmatic Programmers Author

Page 4: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Goals for Today

• Very Modest Goal:

• Understand what cross-platform solutions get you

• … and what they don’t

• Offer my experience on which types of cross-platform solutions make sense

Page 5: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Like It Or Not…

• Cross platform solutions are necessary

• I don’t like it…

• But it’s the world we live in

• Be prepared

Page 6: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

FAQ…

Page 7: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

If we use solution ‘X’, then we can build an app for platform Aand get platform BFOR FREE

Page 8: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

FOR FREE, RIGHT?

Page 9: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Solutions

• Cordova/Phonegap Based

• Titanium

• Xamarin

• Fuse Tools *NEW!

• React Native *SUPER BRAND NEW!

Page 10: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

http://www.gartner.com/technology/reprints.do?id=1-20SX3ZK&ct=140903&st=sb

Page 11: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

wut

Page 12: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Page 13: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Page 14: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

People Want Answers

Page 15: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Page 16: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Page 17: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

First, Let’s Talk About Native

• I strongly believe

Native should be your default preference

Page 18: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Doesn’t HTML Solve Everything?

• Your Mobile Web is important

• A Good Mobile Web Experience is Table Stakes

• Web views replacing native - It’s just not the world we live in yet.

Page 19: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Mobile UX Considerations

• Android users want Android conventions

• iOS users want iOS conventions

• Unless you have a good reason not to

• … and that reason shouldn’t be that you can’t do it with your toolchain

Page 20: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

What About These Solutions, Then?

Page 21: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Mobile Development Strategies

• Mobile Web - i.e. no app

• Single Platform - i.e. iOS only

• Multi-platform

• Cross-Platform

Page 22: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

What Are You Trying to Accomplish?

• Make a one-size-fits-all app?

• Shield developers from learning a new language or platform?

• Save money on development effort?

• Share code, but still build a great UX?

Page 23: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Cross Platform Strategies

• Web-view solutions

• Vendor Technology/APIs

• Native Compilation

Page 24: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Cross Platform Web

• PhoneGap/Cordova Based

• Strategy: Hide cross platform differences, Write with web technologiesRun in web view

• Hard Questions:

• Does it look like a web app?

• Does it feel like a web app?

Page 25: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Cross Platform Interpreted

• Example: Titanium

• Strategy: Hide cross platform differences behind a common, vendor API.Write everything once with web technologies, interpreted on native platforms

• Hard questions:

• How hard is it to fit design to the platform?

• Do I get native performance and experience?

Page 26: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Cross Platform Native

• Example: Xamarin, React Native, RubyMotion

• Strategy: Unified language and platform to native APIs.Runs in native runtime.Write in one language, calling native APIs.

• Hard Questions:

• Do you trust the developer?

• Can they keep up?

Page 27: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

A Syllogism

• Native applications are preferable to web

• and Native execution is preferable to interpreted

• and platform native APIs are preferable to vendor APIs

• Cross platform native apps are native, executed, and access native APIs

• Therefore: Cross native platforms are preferable

• QED

Page 28: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

What’s For Free, Then?

Page 29: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

React Native Dev Quote

• “We’re not chasing the write once, run anywhere pipe dream”

• “Learn Once, Write Anywhere” 28:50 - http://youtu.be/KVZ-P-ZI6W4?t=28m50s

Page 30: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

First, What’s Not Free?

• Platform specific design

• Platform specific expectations

• Technical discovery

• Licensing fees

Page 31: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

The Free Part

• Shared code where it makes sense

• Common understanding across team(s)

Page 32: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Cross Platform Native Strategies

• Share http access

• Share local data layer

• Build to MVVM, share model and view model

Page 33: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Cherry-picking Shared Code

API Access Layer +

Deserialization

iOS UIAndroid UI

Page 34: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Push the Shared Code as Far As You Can

API Access Layer +

Deserialization

iOS UIAndroid UI

Common Data Model Layer

Common View Model Layer

Page 35: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Add Caching and Local Data

API Access Layer +

Deserialization

iOS UIAndroid UI

Common Data Model Layer

Common View Model Layer

Local Datastore

Page 36: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Abstract Platform Services

API Access Layer +

Deserialization

iOS UIAndroid UI

Common Data Model Layer

Common View Model Layer

Local Datastore

Location Manager

CoreLocationInjected Injected

Abstract Location Manager

Page 37: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Xamarin as an Example

Page 38: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Xamarin

• Write in C# using .Net libraries

• Access Platform APIs directly

• Core project (shared code)

• Android project

• iOS project

Page 39: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

An API Client Interface

public interface CheckvistAPI { [Get("/auth/login.json")] Task<string> LogIn(string username, string remote_key); [Get("/checklists.json")] Task<Checklist[]> GetChecklists(string token);}

Page 40: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

iOS Uses It public override void ViewDidLoad () { base.ViewDidLoad (); var client = new CheckvistClient(); var loginTask = new Task(() => { client.LogIn("username", "AP1k3Y"); var checklists = client.GetChecklists(); foreach (var checklist in checklists) { Debug.WriteLine(checklist.Name); } } ); loginTask.Start(); }

Page 41: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Android Uses It protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); var client = new CheckvistClient(); var loginTask = new Task(() => { client.LogIn("username", "AP1k3Y"); var checklists = client.GetChecklists(); foreach (var checklist in checklists) { Console.WriteLine(checklist.Name); } } ); loginTask.Start(); }

Page 42: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Recap

Page 43: Totally Build Apps for Free! (not really)

Presentation tackmobile.com

Recap

• Web technologies are not up to native standards yet

• Cross platform solutions deserve your attention

• Don’t give up access to the native APIs

• Build good apps