James Pearce
 Director, Developer Relations

 @ jamespearce
   jamesp@sencha.com
Building
Tomorrow’s Web
With Today’s Tools
1941
An Experience Designed for the Medium
1995
An Experience Designed for the Medium
2007
An Experience Designed for the Medium
History has taught us
 to embrace change
History has taught us
to question assumptions
History has taught us
to have high expectations
How The Web
is Changing Mobile

     How Mobile
is Changing The Web
2008

We must have an
 iPhone App!
2009

We must have an
 Android App!
2010

We must have an
   iPad App!
2011

We must have a...
omfg
JS
        C# Palm   J2ME
    Microsoft

                        RIM         RIM
                                    Android
                                    Apple
Apple                     Air       Microsoft
                                    Palm
Obj-C
                       Java
         C++ Android            Top U.S. Smartphone Platforms,
                                3 Month Average Ending December 2010
                                comScore MobiLens 2010
But what does this word even mean?




The Mobile Web
Cross-platform
Familiar skills & tools
Decentralized
Easily updated
Indexed
Well-understood technologies
A perfect storm
Documents            Applications

Declarative HTML     Programmatic DOM

Themes & templates       JSON APIs

    Thin client          Thick client

      URLs           Arguments & signals

Request/Response       Synchronization
A New Web Stack
                WebFonts        Video      Audio    Graphics
Device Access                                                  Server & Services

  Camera                    CSS Styling & Layout                    HTTP

  Location                                                          AJAX
                                   JavaScript
  Contacts                                                          Events

    SMS                          Semantic HTML                     Sockets

 Orientation                                                         SSL
                 File Systems        Worker
                                                    x-App
    Gyro              DBs            Parallel                      More...
                                                   Messaging
                  App Cache         Processing
Web technologies
          are a
   viable alternative
to native development
built with

Apps vs Web technology
Documents            Applications

Declarative HTML     Programmatic DOM

Themes & templates       JSON APIs

    Thin client          Thick client

      URLs           Arguments & signals

Request/Response       Synchronization

  Sedentary user         Mobile user



                     This is what it means
Mobile is
an adjective not a noun
480px) {
                and (m ax-width:
@me dia screen
                                      png);
  #logo {          mage: u rl(mobile.
     ba ckground-i
    }
}
Mobile devices are di erent

         GPS device
          Camera
   Music player
      Phone
atio   n/msword
      tent-Ty pe: applic
Con
The Mobile Web
    is not a
  320px Web
How did those assorted
tank tops work out for you?
Techniques
adap tation
            n
ad·ap·ta·tio ˈtāSHəәn/  /ˌadəәp-/
            dap
noun /ˌa
                                o f adapting
                   or process
 1.  The action ted
     or  being adap
                                           r stage play
                         sio n drama, o itten work
  2.  A mo   vie, televi          f rom a wr
                    en adapted
       that has be
                                                 or species
                                an organism nment
                    by which          o its envir
                                                  o
    3.  A change                     t
                     etter suited
        becomes b
Mobile adaptation
    Presentational

   Prioritizational

    Permutational
Presentational adaptation




                  La yout
Prioritizational adaptation




                                   A
                        tion and I
                 N aviga
Permutational adaptation




                         nality
                Fu nctio
The topology of adaptation


 Client    Proxy    Server
Presentational



Prioritizational



Permutational


                   Client   Proxy   Server
‘Passive’ client adaptation




                                              55   </a>
                                   :// 555">5
                        ="   tel
               < a href
Proxy adaptation

There’s a bad sort

There’s a good sort
Server adaptation

  Views
              HTML, CSS...


Controllers
 Models
Server adaptation
           Desktop
Switcher


                     HTML, CSS...
            Mobile


  Controllers
           Models
Device detection with plugins
      WordPress Mobile Pack
      http://wordpress.org/extend/plugins/wordpress-mobile-pack



       WPTouch
       http://wordpress.org/extend/plugins/wptouch



       Drupal Mobile Plugin
       http://drupal.org/project/mobileplugin
Brand consistency
Device detection with PHP
if (isset($_SERVER['HTTP_X_WAP_PROFILE']) { ...

if (in_array(substr($user_agent, 0, 4), $prefixes)) { ...

if (strpos($accept, 'wap') !== false) { ...

if (preg_match("/(" . $keywords . ")/i", $user_agent)) { ...




 https://github.com/jamesgpearce/mobiledetect
Device detection with Rails
class ApplicationController < ActionController::Base
    has_mobile_fu
end



*.mobile.erb

is_mobile_device?
in_mobile_view?



  https://github.com/brendanlim/mobile-fu
Device detection with node.js
   var Connect = require("connect"),
    Monomi = require("monomi");

Connect.createServer(

    Monomi.detectBrowserType(),

    function(request, response, next) {
        response.writeHead(200, {'Content-Type': 'text/plain'});
        response.write('Hello World: ');
        response.end('you are using a ' + request.monomi.browserType);
    }

).listen(8080);




     https://github.com/jamesgpearce/monomi
Detection & user choice
   “Switch to our desktop site”
Thematic consistency
w3c-speak


             http://mysite.com/posts/123



            http://m.mysite.com/posts/123
Using di erent URLs
    can preserve
   the integrity of
     ‘One Web’
Device diversity
Can I Use?
http://caniuse.com

Modernizr
http://modernizr.com

DeviceAtlas
http://deviceatlas.com
dapt ation
                                         a
                            ve c lient           esign
Presentational        Passi                Web
                                                D
                                      sive
                              R espon                 t ation
                                                 adap
                                           Proxy              t ection
                                                   Devi ce de
Prioritizational
                                                                       e
                                                                le sit
                                                         Mobi

Permutational


                   Client           Proxy              Server
dapt ation
                                         a
                            ve c lient           esign
Presentational        Passi                Web
                                                D
                                      sive
                              R espon                 t ation
                                                 adap
                                           Proxy              t ection
                                                   Devi ce de
Prioritizational
                                                                       e
                                                                le sit
                                                         Mobi

Permutational


                   Client           Proxy              Server
A dedicated mobile app
            Desktop
Switchers



             Mobile
             REST
                      JSO    on
  Controllers            N
                               ce

            Models
The stack of the present


                 req/res
User interface             Rendering
Business logic
   Storage
The stack of the future



                  User interface
           sync
Security          Business logic
Storage              Storage

                    The return of
                   the thick client
Do we have time for some
        code?
Progressive enhancement
assumption




   HTML                      JS      CSS


                              progressive
                             enhancement
                                            app




                 doc
                                                  vs




           assumption




HTML              JS                 CSS
                                            app




               detection
               +/- feature
Thick client, thin server


The shortfall in the cloud
http://mysite.com/myimage.png




http://i.tinysrc.mobi/http://mysite.com/myimage.png
dapt ation
                                         a
                            ve c lient           esign
Presentational        Passi                Web
                                                D
                                      sive
                              R espon                 t ation
                                                 adap
                                           Proxy              t ection
                                                   Devi ce de
Prioritizational
                                                                       e
                                                                le sit
                                                         Mobi

                                        p       d su pport
Permutational
                              Mob ile ap Clou


                   Client           Proxy              Server
Mobile is
an adjective not a noun
The Mobile Web
    is not a
  320px Web
History has taught us
 to embrace change
History has taught us
to question assumptions
History has taught us
to have high expectations
James Pearce
 Director, Developer Relations

 @ jamespearce
   jamesp@sencha.com

Building tomorrow's web with today's tools