Mobile Web

from client to server

~ In 15 minutes

TDC 2012

@abstractj

DISCLAIMER

In the past...

JME

A limited platform

to Limited devices

Limited browsers

WAP srsly?!

SMS

srsly?!

Present

Mobile > Desktop

But still limited!

Native

Controlled marketplace

  • Android
  • iOS
  • BlackBerry
  • Windows Mobile


Several use cases

Hybrid

More "updateable"

  • HTML5
  • JavaScript
  • CSS3
  • Webkit


Several use cases

TRADE-OFFS

It's up to you!

WWW

World Wild Web

Challenges

  • A uniform interface between client/server
  • Security
  • Mobile networks are unstable
  • Avoid multiple HTTP requests (make fewer HTTP requests)
  • Serialization can decrease performance

Phone != Desktops

  • Screen size limitation
  • Battery life
  • Memory
  • Responsiveness
  • Browser support (we care)

Several APIs

  • HTML5 Filesystem API
  • LocalStorage
  • Security
  • Geolocation
  • Device orientation
  • Battery API
  • WebRTC (voice & video)...

Like this...


input type="text" x-webkit-speech=""

HTML5 + REST

The good parts!

Getting started

Maven or Eclipse are your friends

Sometimes

Getting started

mvn archetype:generate \
        -DarchetypeArtifactId=jboss-html5-mobile-archetype \
        -DarchetypeGroupId=org.jboss.aerogear.archetypes\
        -DarchetypeVersion=1.0.0.M4

Deployment

Start JBoss

$JBOSS_HOME/bin/standalone.sh

Run Maven

mvn package
mvn jboss-as:deploy

Eclipse

JBoss Tools

Testing

QUnit

QUnit is a JavaScript unit testing framework used and built by jQuery - Aerogear

Testing

QUnit

module('Member Row Construction');
test('Build 0 member Rows', function() {
    expect(1);
    var members = [];
    var html = buildMemberRows(members);
    ok($(html).length == 0, 'Created no rows for empty members');
});

Testing

QUnit

Experiments

Cordova

Hybrid apps to Android & IPhone

How to convert HTML5 to Android & IPhone

Do you <3 Ruby?!

Environment

rvm install jruby
rvm gemset create aerogear
rvm use jruby@aerogear

Download

git clone https://github.com/aerogear/kitchensink-torquebox-mobile.git
jruby -S bundle install
rake torquebox:deploy

Real example

http://tb-aerogear.rhcloud.com/

What's next?!

  • Persistence libraries
  • Security libraries
  • Client/server improvements

Community

Thanks

@abstractj