The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

82

description

 

Transcript of The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Page 1: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife
Page 2: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Caridy PatiñoBartender at Yahoo! Mojito TeamPrincipal Engineer at Yahoo! Search

[email protected]@caridy#feecbr

Page 3: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife
Page 4: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

The challenges ofbuilding mobile HTML5 applications

Page 5: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Goal

“to see the big picture”

Page 6: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

The Web and the mobile revolution

Page 7: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

“The Web is the most hostile software development environment imaginable”

- Douglas Crockford

5 years ago

Page 8: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

But the future was looking bright:

- Javascript libraries getting popular- ECMAScript 5 on the making- Chrome Browser on the making

Page 9: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

But then few things happened:

Page 10: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife
Page 11: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife
Page 12: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

and somehow, we ended up here:

Page 13: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

@davglass’s lab

Page 14: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

“The Mobile Web is even worse today and it is not going to get any better anytime soon.”

today

Page 15: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

What path to choose?

Page 16: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Web Applications

Page 17: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Text“A web application is any application that uses a web

browser as a client.”

Page 18: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Text“A web application is any application that uses a web

browser runtime as a client.”

Page 19: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

TextA mobile web application is any web application

that implement a highly interactive UIspecifically optimized for mobile devices.

Page 20: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

3 types of mobile web applicationsthat you can build today

Page 21: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

+

Native Web

WebViews + Local Web App

native wrapper

Page 22: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

- Part of hybrid apps- Based on WebViews*- HTML, JS and CSS are bundled with app- Can work offline- Mimic native behavior

Page 23: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

+

Native Web

WebViews + Remote Web App

native wrapper

Page 24: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

- Part of hybrid apps- Based on WebViews*- HTML, JS and CSS are downloaded over HTTP- Requires network activity- Mimic native behavior

Page 25: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Expect network craziness

Page 26: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Network failures need to be controlled

Page 27: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

CSS can also fail when loading web-based apps

Page 28: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

http://blog.mobtest.com/2012/05/heres-why-the-facebook-ios-app-is-so-bad-uiwebviews-and-no-nitro/

Initialization needs to be controlled

Page 29: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Browser based apps

pure web

Page 30: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

- Pure web apps- Require a browser- HTML, JS and CSS are downloaded over HTTP- Inherit the freedom of the Web- Discoverability is inherited as well

Page 31: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

The total mess of mobile web

Page 32: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

form factors

RIP

Page 33: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Touch screen saves us fromthose crazy form-factors

Page 34: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

The synergy across form factors

Page 36: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

http://netmarketshare.com/

Fragmentation

Page 37: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Android 4 is set to solvebrowser fragmentationwe will see

Page 38: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Desktop + Mobile form factors

Page 39: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Runtimes

Page 40: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

A runtime is a web engine container that can run a web application in a form of HTML, JS and CSS

Page 41: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

A mobile browser, a webview and phonegap areexamples of runtimes

Page 42: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Windows 8 has 4 runtimes:

- IE Start Screen Mode (Formerly known as Metro)- IE Desktop Mode- WebView (within Native Windows 8 App)- Native Windows Runtime (Windows Store apps)

https://github.com/yui/yui3/wiki/Windows-8-JavaScript-Runtimes

Page 43: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Runtimes allow us to run the same web appin different contexts

Page 44: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Every runtime has its own characteristics, features and security models

Page 45: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Developing for a single runtime is notlonger an option for most products

Page 46: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Applications will tent to grow organically by adding complexity and new logical pieces

Page 47: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife
Page 48: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Reusing UI elements and logical piecescould be paramount

Page 49: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife
Page 50: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Design specs distribution per device

Page 51: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Reusing is the biggest problem of allin a mobile web application

Page 52: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife
Page 53: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Optimization & Adaptation

Page 54: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Optimization vs Adaptation

Page 55: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Optimization vs Adaptation

Page 56: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Snow Chains to adapt your vehicle

Page 57: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Optimization vs Adaptation

Page 58: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Optimization

Page 59: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Optimization is about customizing the way your app behaves per runtime

Page 60: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

It is about producing the right HTML, JS and CSS per runtime

Page 61: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Adaptation

Page 62: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Adaptation is about customizing the UI per screen size, per connection speed, per feature detection, etc.

Page 63: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

- Screen size- Orientation- Connection Speed- Memory- etc.

Adapt per:

Page 64: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

The Twitter Tale

Page 65: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

2010

Page 66: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Twitter launched a new version of the web application that explicitly required javascript

2010

Page 68: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Runtime FE Layer CDN API Layer

HTML

Javascript

Content

Page 69: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

The problem?The app was sloooowwwww for

a lot of users, specially mobile users.

Page 70: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Less than a year after, Twitter re-architected the infrastructure to get content upfront

Page 71: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Runtime FE Layer CDN API Layer

HTML

Javascript

Content

More Content

Page 72: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

How can we create web applications that are flexible enough?

Page 73: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Use the same language everywhere!and that language is JavaScript.

Page 74: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Javascript everywhere:

Page 75: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife
Page 76: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Final notes...

Page 77: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Build mobile applications on top of platforms designed primarily for

mobile products

Page 78: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

The web it’s all about control,your control

Page 79: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

write once, run everywhere, no so easy!

Page 80: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Customize per runtime & context,adapt per form factor & feature detection

Page 81: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Build for the future,don't get locked into a platform.

Page 82: The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife

Obrigado @caridy