55

HTML5 or Android for Mobile Development?

Embed Size (px)

DESCRIPTION

Android apps or the mobile web? It's often a hard choice when deciding where to invest your mobile development resources. While the mobile web continues to grow, apps and app stores are incredibly popular. We will present both perspectives and offer some suggestions for making the most of each platform.

Citation preview

Page 1: HTML5 or Android for Mobile Development?
Page 2: HTML5 or Android for Mobile Development?

Revised v4Presenter

Web or Native for Mobile Development?

Android Reto Meier @retomeier

Web Michael Mahemoff @mahemoff

Page 3: HTML5 or Android for Mobile Development?

The Question

• Should you build you mobile apps as HTML5 apps or native apps?

Page 4: HTML5 or Android for Mobile Development?

The Answer

YES

Page 5: HTML5 or Android for Mobile Development?

The Case for Native Apps

Page 6: HTML5 or Android for Mobile Development?

If you can't think of a way to improve your web app using Android SDK features...

Page 7: HTML5 or Android for Mobile Development?

If you can't think of a way to improve your web app using Android SDK features...

You're doing it wrong!

Page 8: HTML5 or Android for Mobile Development?
Page 9: HTML5 or Android for Mobile Development?

Standards Will Always Trail Innovation

• Hardware support• Rich Integration

Page 10: HTML5 or Android for Mobile Development?

Impending Hardware Standards

• Location Based Services• Microphone input• Accelerometers

Page 11: HTML5 or Android for Mobile Development?

Hardware is Rapidly Evolving

• 2007: Multi-touch, accelerometers, microphone• 2008: Video, compass, background apps• 2009: Bluetooth, multiple screen sizes• 2010: Gyroscopes, front facing cameras, NFC• 2011: ???

Page 12: HTML5 or Android for Mobile Development?

New Hardware Platforms

• Tablets• Televisions• Cars? Picture Frames? Fridges? Washing Machines?

Page 13: HTML5 or Android for Mobile Development?

Currently Supported Hardware

• Smartphones / Tablets / Television• Microphone• Video camera (front facing / rear facing)• Sensors (compass, gyro, accelerometers, light• Multi-touch• Telephony and SIP stacks• Bluetooth

Page 14: HTML5 or Android for Mobile Development?

Intents Based Data Sharing

• Lets 3rd parties exchange data• Lets apps extend each other

Page 15: HTML5 or Android for Mobile Development?

Ubiquity

• Widget, Live Folders, Live Wallpapers• Quick Search Box• Notifications• Ability to replace native apps

Page 16: HTML5 or Android for Mobile Development?

True Background Services

• Alarms• Intent Receivers• Cloud to Device Messaging• Background execution / concurrent apps

Page 17: HTML5 or Android for Mobile Development?

Current Android Platform Features

• Geo services• Sensors• Interprocess communications (Intents!)• Background, scheduled, and concurrent apps• Home screen widgets and quick search box• Rich multimedia• Native (C/C++) development• Full database / SQLLite support• Camera and microphone access• Deep system integration / replacement

Page 18: HTML5 or Android for Mobile Development?

Native App Strengths

• Apps that use the hardware • Apps that integrate system features• Apps that work with other apps• Apps that need to be fast• Apps that are ubiquitous

Page 19: HTML5 or Android for Mobile Development?

The Case for HTML5

Page 20: HTML5 or Android for Mobile Development?

Remember when computers were computers?

Page 21: HTML5 or Android for Mobile Development?

TVs were TVs?

Page 22: HTML5 or Android for Mobile Development?

Mobile phones were thumping great bricks?

Page 23: HTML5 or Android for Mobile Development?

Form Factors Rock!

Page 24: HTML5 or Android for Mobile Development?

Form Factors Rock

... for users!

But less so for developers.

Page 25: HTML5 or Android for Mobile Development?

Modern Developer,You need to consider ...Desktop

Laptop

Netbook

Smartphone

Feature phone

Tablet

TV

Page 26: HTML5 or Android for Mobile Development?

As a Developer, you need to consider ...Watch?

Car?

Fridge?

USB Desktop Aquarium?

(Maybe not.)

Page 27: HTML5 or Android for Mobile Development?

Desktop

Windows

OSX

Linux

...

Page 28: HTML5 or Android for Mobile Development?

MobileAndroid

iOS

BlackBerry

Windows Mobile 6.5

Windows Mobile 7 (rewrite)

Symbian

Meego

...

Page 29: HTML5 or Android for Mobile Development?

How about in 2015?

Anyone's guess!

But one platform is likely to be there: Web.

Page 30: HTML5 or Android for Mobile Development?

Write Once, Run Manyis starting to sound like a good idea

Page 31: HTML5 or Android for Mobile Development?

Web Handles Many User InterfacesBrowsers use a fluid layout model.

Sensible defaults, whether a 10cm phone or a 200cm TV

Target specific platforms with CSS Media Queries

Page 32: HTML5 or Android for Mobile Development?

Web Provides Secure Sandboxing

Same-origin policy prevents sharing across different domains

Page 33: HTML5 or Android for Mobile Development?

Web Provides Porous Boundaries

It's not black-and-white.

Apps *can* share data securely - OAuth, Cross-Origin Resource Sharing, Cross-Document Messaging.

Page 34: HTML5 or Android for Mobile Development?

Web Supports Permissioning

Now we have rich functionality on the web, e.g. GeoLocation.

But not every app gets access.

As with smartphones, browsers ask permission first.

Page 35: HTML5 or Android for Mobile Development?

So Web Architecture is Good in Theory

How about in practice?

Page 36: HTML5 or Android for Mobile Development?

HTML5 is Ready Today

Not 2050, Not 2020. Today.

Page 37: HTML5 or Android for Mobile Development?

HTML5 is Ready Today

Oh and it's fast too

Javascript Performance Benchmarkhttp://is.gd/dAKqSFirefox 0.8 (2004): 1802msChrome 7 (2010): 10ms

DOM Rendering Benchmarkhttp://jsperf.com/dom-selection-appending/2Firefox 0.8 (2004): ~111ms (9 ops/sec)Chrome 7 (2010): 2ms (460 ops/sec)

Page 38: HTML5 or Android for Mobile Development?

User Interface: Canvas

Canvas: Effect Engine

HTML5 Game Jam: "Enterprise"

Page 39: HTML5 or Android for Mobile Development?

User Interface: CSS

Custom FontsTransformsMuch more...

Page 40: HTML5 or Android for Mobile Development?

Input

Geolocation

Orientation

Speech Detection

Idle Detection

Device API: Camera? Microphone?http://flickr.com/photos/mofetos/435827739/

Page 41: HTML5 or Android for Mobile Development?

Networking

Your Grandpa's HTML:LinksForms

Ajax:XMLHttpRequest

Now:Cross-Domain access with CORS2-Way Streaming with WebSocketServer-Sent Events with EventSource

Page 42: HTML5 or Android for Mobile Development?

Offline

Application Caching

Web StorageWeb SQL DatabaseIndexed DatabaseFile Access

Page 43: HTML5 or Android for Mobile Development?

Installable, if you want to

Mobile: PhoneGap, Titanium, Roll-Your-Own

Desktop: Google Chrome Web Store

Page 44: HTML5 or Android for Mobile Development?

And Besides Compatibility ...

Open standards

Open source

Easy to dive in

Tools and library support

Diverse community

Page 45: HTML5 or Android for Mobile Development?

Want to Learn More?

HTML5Rocks.comChromeExperiments.com

Want to Learn Even More?http://www.html5rocks.com/resources.html

Page 46: HTML5 or Android for Mobile Development?

'Which?' is the Wrong Question

Page 47: HTML5 or Android for Mobile Development?

Web Apps• Near universal coverage• Deploy once, update instanly

Native Apps• Deep hardware and platform integration• Support for rapid hardware innovation• Device and platform specific features• Optimized user experience

Two Great Tastes that Taste Great Together

Page 48: HTML5 or Android for Mobile Development?

• Yes!• Build a web client first to offer your app to the largest

possible community of users.• Build an optimized native client that leverages platform

specific features and an optimized user experience.

Both? Really?

Page 49: HTML5 or Android for Mobile Development?

• Hardware access?• Feel the need for speed?• Background or concurrent execution?• System access?• Deep integration?

Understand Your App's Needs

Page 50: HTML5 or Android for Mobile Development?

HTML5 in Native

Most platforms include a native Web View control.

Include Web View for specific featuresBook reader: The catalogueGame: High scores

or use HTML5 for the entire app ...

Page 51: HTML5 or Android for Mobile Development?

HTML5 for Entire App

Wrap HTML5 app as native.Can also use native capabilities.Nitobi PhoneGaphttp://phonegap.com/appshttp://build.phonegap.com (private beta)http://apparat.io/ from Uxebu (private beta)Appcelerator Titaniumhttp://appcelerator.com

Page 52: HTML5 or Android for Mobile Development?

Native Apps with HTML5

Make it work offline.

Use client-side storage when offline.

Don't point to server...package it up!Or use Application Cache and Client-Side Storage.

Page 53: HTML5 or Android for Mobile Development?

Native Apps with HTML5

Prioritize platforms.For high-priority platforms, customise UI and incorporate native features.

CSS Media Queries.JavaScript Feature Detection (Modernizr library).

Introduce native styling.UI Toolkits: Sencha Touch, jQTouch, jQuery Mobile ...

Page 54: HTML5 or Android for Mobile Development?

Questions!

• Twitter: o @retomeier (Android)o @mahemoff (Web)

Page 55: HTML5 or Android for Mobile Development?