Mobile web& hybrid apps



Mobile web& hybrid apps

0 2


preso-mobile-web-and-hybrid-apps


On Github rprieto / preso-mobile-web-and-hybrid-apps

Mobile web& hybrid apps

Romain Prieto

June 2012

It's just for basic apps...

Mythbusted
1
They're slow

UI frameworks

You don't have to use everything

ex: jQuery mobile

<a href="#"
data-role="button"     data-icon="arrow-l"
data-corners="true"    data-shadow="true"
data-iconshadow="true" data-wrapperels="span">
</a>
						

Just a button...

<a href="#" class="ui-btn ui-shadow ui-btn-corner-all ui-btn-icon-left ui-btn-up-c"><span class="ui-btn-inner ui-btn-corner-all"><span class="ui-btn-text"></span><span class="ui-icon ui-icon-arrow-l ui-icon-shadow"> </span></span>
						

3 nested elements, 11 classes

Fancy transitions

Danger zone

Responsiveness

HTML5 touch events

addEventListener('touchstart');
// give feedback

addEventListener('touchmove');
// moving too much?

addEventListener('touchend');
// click!
					

Javascript is slower

  • How much processing?
  • Be efficient

Search 20,000 post codes

Runs the regex 20,000 times

function matches(rgx) {
    return function(text) {
        return rgx.test(text);
    }
}

list.filter(matches(/Syd/))
    .slice(0, 3);
						

Lazy evaluation

3 < times < 20,000

// streamjs to the rescue

Stream.make(...)
      .filter(matches(/Syd/))
      .take(3)
						
2
They don't look native

The uncanny valley

http://www.agriffindesign.com/blog.php?id=3

A few CSS tips

Not a web page

-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-user-select: none;
					

Scrolling, improved

/* On the container */
overflow: scroll;
-webkit-overflow-scrolling: touch;

/* On the items */
-webkit-transform: translate3d(0,0,0);
					

+ Full native bounce scroll trick

Sticky content

position: fixed;
height: 50px;
z-index: 1;
					

No native widgets?

Hybrid bridges / PhoneGap

“not just for the accelerometer”

Fast & looks good

What's missing

3
Treat all platforms the same Not flexible Don't scale

THIS

IS

SOFTWARE!

Web app = web server

"But I just have static pages?"

Middleman

  • HAML, SASS, Compass
  • ERB, partials, routes
   <% if target == :android %>

build

Build it!

platforms includes assets jshint jasmine android signing iphone testflight

Modular JS

Going back?

Routing module

Different platforms

Purchase

Android

iPhone

Browser

What's the limit?

  • Smooth animations
  • Heavy graphics
  • Infinite scrolling
  • Pixel perfection

http://www.phoboslab.org/xtype/

   THE END.

Or is it?

reveal.js

with animations

because it's fun

github.com/rprieto/reveal.js