building a real time html5 app for mobile devices

27
Building a Real-Time HTML5 App for Mobile Devices Tony Abou-Assaleh Co-founder & CTO, TitanFile [email protected] Twitter: @tony_aa Mobile P2P – November 14, 2012

Upload: tony-abou-assaleh

Post on 22-May-2015

2.632 views

Category:

Technology


2 download

DESCRIPTION

The HTML5 standard turned out to be not so standard when it comes to cross-platform implementations - from handling touch events, to CSS transitions, to WebSockets, to performance. This presentation will share some of the lessons we learned the hard way developing the TitanFile mobile app using HTML5/JavaScript/CSS3.

TRANSCRIPT

Page 1: Building a real time html5 app for mobile devices

Building a Real-Time HTML5 App for Mobile Devices

Tony Abou-AssalehCo-founder & CTO, TitanFile

[email protected]

Twitter: @tony_aa

Mobile P2P – November 14, 2012

Page 2: Building a real time html5 app for mobile devices

About me …

• PhD in … natural language processing– Not mobile

• Ex-Googler .. in ads– Not mobile

• Hardcore backend programmer• Past year - TitanFile: RT SPA– HTML5/JS/CSS/Async/Django/…

Page 3: Building a real time html5 app for mobile devices

Agenda

• Why HTML5?• Challenges• Design Tips• “Real-time” Tips• Mobile HTML5 Myths

Page 4: Building a real time html5 app for mobile devices

Why HTML5?

Page 5: Building a real time html5 app for mobile devices

Why HTML5?

• Cross-platform• W3C standard• Open source• Lots of libraries• Transferable skills• Cordova = native• It’s easy! Just HTML + JS + CSS + Backend

Page 6: Building a real time html5 app for mobile devices

Or so we thought …

Page 7: Building a real time html5 app for mobile devices

Why not HTML5?

• Not cross-platform• Standard-in-progress• Open Source – yeah right!• Lots of libraries that don’t work• Cordova Native• It’s NOT just HTML + JS + CSS + Backend

Page 8: Building a real time html5 app for mobile devices

So why HTML5?

Page 9: Building a real time html5 app for mobile devices

So why HTML5?

• Gets you to give a talk at mobile P2P• Still easier than native• Transferable skills

Page 10: Building a real time html5 app for mobile devices

Challenges

Page 11: Building a real time html5 app for mobile devices
Page 12: Building a real time html5 app for mobile devices
Page 13: Building a real time html5 app for mobile devices

Website Web App

• Single Page App• Background Data Sync• Asynchronous Processing• Responsiveness• Design

Page 14: Building a real time html5 app for mobile devices

Web App Mobile App

• Usage Patterns• Touch Events• Drag-and-drop• Scrolling• Pixel Ratio

Page 15: Building a real time html5 app for mobile devices

Web iPad Android PlayBook BB10

Page 16: Building a real time html5 app for mobile devices

Design Tips

Page 17: Building a real time html5 app for mobile devices

Design Tips

• Start with design, not prototype• Images, not button• Avoid text links• No modal dialogues• Use CSS media queries• Provide hi-res images as needed

Page 18: Building a real time html5 app for mobile devices

“Real-Time” Tips

Page 19: Building a real time html5 app for mobile devices

“Real-Time” Tips - Tools

• Use Font-end Framework– Backbone/Marionette/Relational

• Use Back-end Framework– Django/Tornado/Celery

• Use WebSocket Wrapper– Socket.io or SockJS

• Use a CSS Framework– Bootstrap

• Write your own!

Page 20: Building a real time html5 app for mobile devices

“Real-Time” Tips - Data

• Server push-events• Asynchronous Processing• Incremental Loading

Page 21: Building a real time html5 app for mobile devices

“Real-Time” Tips – Front-end

• Only render visible DOM• No anchor tags• No HTML5 drag-and-drop• Use native scrolling

Page 22: Building a real time html5 app for mobile devices

Mobile HTML5 Myths

Page 23: Building a real time html5 app for mobile devices
Page 24: Building a real time html5 app for mobile devices

Myth 1: HTML5 is Cross-Platform

Page 25: Building a real time html5 app for mobile devices

Myth 2: HTML5 is Slow

• Not if …– Load data incrementally– Only render what’s visible– User global event listeners– User WebKit CSS transforms

• Hardware Acceleration

Page 26: Building a real time html5 app for mobile devices

Myth 3: Not as effective as Native

Page 27: Building a real time html5 app for mobile devices

Summary

• Developing HTML5 mobile apps is …– Easier than native– Cheaper than native– Tricky– Fun!