cross-platform development in the context of mobile web

45
Mobile and Cross-Platform using web technologies

Upload: misha-reyzlin

Post on 11-Jul-2015

67 views

Category:

Engineering


3 download

TRANSCRIPT

Page 1: Cross-platform development in the context of mobile web

Mobile and Cross-Platformusing web technologies

Page 2: Cross-platform development in the context of mobile web

Hello!My name is Misha Reyzlin I’m JavaScript Engineer @SoundCloud

Page 3: Cross-platform development in the context of mobile web
Page 4: Cross-platform development in the context of mobile web

Why mobile?

Page 5: Cross-platform development in the context of mobile web

Why mobile?mobile is huge, really huge

Page 6: Cross-platform development in the context of mobile web

Why mobile?mobile is huge, really huge91% people in the world own mobile device

Page 7: Cross-platform development in the context of mobile web

Why mobile?most of our plays come from mobile

Page 8: Cross-platform development in the context of mobile web
Page 9: Cross-platform development in the context of mobile web

Mobile?

Page 10: Cross-platform development in the context of mobile web
Page 11: Cross-platform development in the context of mobile web

title, date, 01 of 10

Page 12: Cross-platform development in the context of mobile web

HTML

title, date, 01 of 10

● accessible, no installs

Page 13: Cross-platform development in the context of mobile web

HTML

title, date, 01 of 10

● accessible, no installs● one codebase

Page 14: Cross-platform development in the context of mobile web

HTML

title, date, 01 of 10

● accessible, no installs● one codebase

● no review process

Page 15: Cross-platform development in the context of mobile web

Native

title, date, 01 of 10

● More APIs available

Page 16: Cross-platform development in the context of mobile web

Native

title, date, 01 of 10

● More APIs available● Performance

Page 17: Cross-platform development in the context of mobile web

Native

title, date, 01 of 10

● More APIs available● Performance

● Complex UI is easier

Page 18: Cross-platform development in the context of mobile web

Phonegap

title, date, 01 of 10

Wraps HTML apps in native, providing access to some APIs

Page 19: Cross-platform development in the context of mobile web

HTML & Native

title, date, 01 of 10

They compliment each other:● Hit URL and listen to sound● Download app, do more

complex interactions

Page 20: Cross-platform development in the context of mobile web

Standards

title, date, 01 of 10

In 2007 iPhone came out with support for rich media <audio> and <video>No Flash

Page 21: Cross-platform development in the context of mobile web

Standards

title, date, 01 of 10

Google:<input type="text" x-webkit-speech />

Page 22: Cross-platform development in the context of mobile web

Standards

title, date, 01 of 10

Microsoft:pointer events, mixed input – touch and mouse

Page 23: Cross-platform development in the context of mobile web

Standards

title, date, 01 of 10

Mozilla:A lot of general enhancements to JavaScript

Page 24: Cross-platform development in the context of mobile web

Standards

title, date, 01 of 10

Mozilla:A lot of general enhancements to JavaScript

Page 25: Cross-platform development in the context of mobile web

How is SoundCloud built?

Page 26: Cross-platform development in the context of mobile web

History (2005)

title, date, 01 of 10

● user types URL● Apache+PHP parse req.● Query DB● print HTML as response

Page 27: Cross-platform development in the context of mobile web

History (2005)

title, date, 01 of 10

● browser renders HTML● fetches resources (JS,

CSS)● JS enhances UX

Page 28: Cross-platform development in the context of mobile web

History (2006)

title, date, 01 of 10

● Prototype.JS with $ function

● YUI ● jQuery

Page 29: Cross-platform development in the context of mobile web

title, date, 01 of 10

$('.images').beautifulGallery();$('.navigation a').each(function (link) { link.click(function (event) { event.preventDefault(); $('.animated').animate({ top: '-100px' }, 500); });});

Page 30: Cross-platform development in the context of mobile web

title, date, 01 of 10

$('.images').beautifulGallery();$('.navigation a').each(function (link) { link.click(function (event) { event.preventDefault(); $('.animated').animate({ top: '-100px' }, 500); });});

Page 31: Cross-platform development in the context of mobile web

title, date, 01 of 10

$('.images').beautifulGallery();$('.navigation a').each(function (link) { link.click(function (event) { event.preventDefault(); $('.animated').animate({ top: '-100px' }, 500); });});

Page 32: Cross-platform development in the context of mobile web

● Desire to match application performance

● No hard page refreshes ● AJAX

History (2007)

title, date, 01 of 10

Page 33: Cross-platform development in the context of mobile web

● init state from URL● HTTP requests to API● render HTML from the API

data

Move to JS

title, date, 01 of 10

Page 34: Cross-platform development in the context of mobile web

● lack of modules & dependency management

● testability and isolating units● no separation of concerns● memory management

How to write JS?

title, date, 01 of 10

Page 35: Cross-platform development in the context of mobile web

"Pro JavaScript Design Patterns"Creation of objects, architecture, behaviour

Solutions (2007)

title, date, 01 of 10

Page 36: Cross-platform development in the context of mobile web

● Massive UI frameworks (sproutcore, EXT.js)

● Compiled (Objective-J and GWT)● Rich widget libs (YUI, DOJO,

jQuery plugins)

Solutions (2008-09)

title, date, 01 of 10

Page 37: Cross-platform development in the context of mobile web

Lightweight frameworkpromoted MVC patternfor UI development (on the client side)

Backbone (2010)

title, date, 01 of 10

Page 38: Cross-platform development in the context of mobile web

The main idea is separation of concerns

MVC

title, date, 01 of 10

Page 39: Cross-platform development in the context of mobile web

Model and View types implement pub/sub pattern

Backbone MVC

title, date, 01 of 10

Page 40: Cross-platform development in the context of mobile web

var model = new Model();var view = new View(model);// in View::constructormodel.on(‘change’,view.render

);

title, date, 01 of 10

Page 41: Cross-platform development in the context of mobile web

var model = new Model();var view = new View(model);// in View::constructormodel.on(‘change’,view.render

);

title, date, 01 of 10

Page 42: Cross-platform development in the context of mobile web

title, date, 01 of 10

Page 43: Cross-platform development in the context of mobile web

title, date, 01 of 10

Page 44: Cross-platform development in the context of mobile web

title, date, 01 of 10

Page 45: Cross-platform development in the context of mobile web

Thank you

[email protected]

http://twitter.com/gryzzly