SlideShare une entreprise Scribd logo
1  sur  93
Taking your web app
     for a walk
     Jens-Christian Fischer

         soft-shake.ch
          3.10.2011
So who‘s this guy?
So who‘s this guy?

• I have a job: Developer & CEO
So who‘s this guy?

• I have a job: Developer & CEO
• I have a company: http://invisible.ch
So who‘s this guy?

• I have a job: Developer & CEO
• I have a company: http://invisible.ch
• I have an email address: jens-christian@invisible.ch
So who‘s this guy?

• I have a job: Developer & CEO
• I have a company: http://invisible.ch
• I have an email address: jens-christian@invisible.ch
• I‘m on Twitter: @jcfischer
So who‘s this guy?

• I have a job: Developer & CEO
• I have a company: http://invisible.ch
• I have an email address: jens-christian@invisible.ch
• I‘m on Twitter: @jcfischer
• I‘m on Google+: 109789939743085010576
http://www.flickr.com/photos/hgesell/1257717725/
Web




http://www.flickr.com/photos/hgesell/1257717725/
iO
        S           -C          oid
               i ve    A  n dr
           c t
      b je             Da
    O
Win Ph                    lvi
       one7 Bl                k
                      ac
            C#           kb
      O  S                  er
 W eb                          ry
     IP ?)
  (R
What are we going to do?
What are we going to do?
6 Steps towards mobile apps
6 Steps towards mobile apps
  1. HTML 5 / CSS 3
6 Steps towards mobile apps
  1. HTML 5 / CSS 3
  2. Responsive Design
6 Steps towards mobile apps
  1. HTML 5 / CSS 3
  2. Responsive Design
  3. Offline / Local Storage
6 Steps towards mobile apps
  1. HTML 5 / CSS 3
  2. Responsive Design
  3. Offline / Local Storage
  4. UI Frameworks (jQuery Mobile / Sencha)
6 Steps towards mobile apps
  1. HTML 5 / CSS 3
  2. Responsive Design
  3. Offline / Local Storage
  4. UI Frameworks (jQuery Mobile / Sencha)
  5. Using the device (PhoneGap)
6 Steps towards mobile apps
  1. HTML 5 / CSS 3
  2. Responsive Design
  3. Offline / Local Storage
  4. UI Frameworks (jQuery Mobile / Sencha)
  5. Using the device (PhoneGap)
  6. Being Native (Titanium)
6 Steps towards mobile apps
         1. HTML 5 / CSS 3
         2. Responsive Design
         3. Offline / Local Storage
         4. UI Frameworks (jQuery Mobile / Se
         5. Using the device (PhoneGap)
         6. Being Native (Titanium)
1
CSS
WebKit
2
Responsive Design
Responsive Design
CSS Media Queries
@media handheld, only screen and (max-width: 1280px) { .wrapper { padding: 0; }
  #header { position: absolute; }
  #header .center { position: relative; width: 100%; }
  #logo { margin: 0; left: 32px; top: 8px; }
  #content { width: 100%; margin: 0 auto; padding: 154px 0 240px 0; }
  #footer { position: absolute; bottom: 0; left: 0; } }
@media handheld, only screen and (max-width: 768px) { .wrapper { padding: 0; }
  .entry { margin-left: 0; }
  h1 { font-size: 1.3em; }
  #logo { left: 8px; top: 8px; }
  #useless { display: none; }
  #panel { display: none; }
  #content { padding: 154px 0 240px 0; width: 100%; height: 100%; }
  #footer { position: absolute; max-width: 768px; bottom: 0; left: 0; }
  .text { margin: 0; } }
@media handheld, only screen and (max-width: 480px) {
  .left { float: none; margin: 0 0 0 86px; } }
@media handheld, only screen and (max-width: 320px) {
  .left { margin: 0 0 0 8px; } }
http://www.alistapart.com/articles/responsive-web-design/
3
Going Offline


• Caching Files offline
• Local Storage
Cache Manifest
<!DOCTYPE HTML>                        CACHE MANIFEST
<html manifest="/cache.manifest">      FALLBACK:
<body>                                 / /offline.html
...                                    NETWORK:
</body>                                /tracking.cgi
</html>                                CACHE:
                                       /clock.css
                                       /clock.js
                                       /clock-face.jpg




http://diveintohtml5.org/offline.html
Cache Manifest
    CACHE MANIFEST
    FALLBACK:
    / /offline.html
    NETWORK:
    /tracking.cgi
    CACHE:
    /clock.css
    /clock.js
    /clock-face.jpg




http://diveintohtml5.org/offline.html
Cache Manifest
    CACHE MANIFEST
    FALLBACK:
    / /offline.html          If not cached, show this
    NETWORK:
    /tracking.cgi
    CACHE:
    /clock.css
    /clock.js
    /clock-face.jpg




http://diveintohtml5.org/offline.html
Cache Manifest
    CACHE MANIFEST
    FALLBACK:
    / /offline.html          If not cached, show this
    NETWORK:
    /tracking.cgi                      Dont‘t cache
    CACHE:
    /clock.css
    /clock.js
    /clock-face.jpg




http://diveintohtml5.org/offline.html
Cache Manifest
    CACHE MANIFEST
    FALLBACK:
    / /offline.html          If not cached, show this
    NETWORK:
    /tracking.cgi                      Dont‘t cache
    CACHE:
    /clock.css
    /clock.js                     Cache these files
    /clock-face.jpg




http://diveintohtml5.org/offline.html
Local Storage
           Simple Key - Value store


if (Modernizr.localstorage) {
  var foo = localStorage.getItem("key");
  // ...
  localStorage.setItem("key", foo);
} else {
  alert('No storage capabilities');
}
            http://diveintohtml5.org/storage.html
More than Key-Value?
More than Key-Value?

  Web SQL
 Indexed DB
More than Key-Value?

  Web SQL
 Indexed DB
More than Key-Value?

  Web SQL
 Indexed DB
  hic sunt dracones
http://flickr.com/photos/glennharper/49536169/
how far have we come?




            http://flickr.com/photos/glennharper/49536169/
4
jQuery Mobile
  • Shares the name with jQuery (and
    uses it)
  • HTML Code with annotations
  • JavaScript for functionality
    http://jquerymobile.com
Sencha Touch

• Grown out of the Ext JS Framework
• JavaScript Code for design
• HTML is just a container
  http://www.sencha.com/products/touch/
jQuery Mobile
jQuery Mobile
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name = "viewport" content = "initial-scale = 1.0, user-scalable = no">
        <title>To Do List</title>
        <script src="../../_libs/jqm/jquery-1.6.2.min.js"></script>
        <script src="../../_libs/jqm/jquery.mobile-1.0b3.min.js"></script>
        <script src="../../_libs/persistencejs/lib/persistence.js"></script>

        <link href="../../_libs/jqm/jquery.mobile-1.0b3.min.css" rel="stylesheet">
        <link href="../../_libs/jqm/jquery.mobile.datebox-1.0b1.min.css" rel="stylesheet">

        <script src="app.js"></script>
        <link rel="apple-touch-icon" href="icon.png"/>
        <link rel="apple-touch-startup-image" href="res/img/Default.png" />
    </head>
    <body>
        <!-- Index page-->
        <div data-role="page" id="indexPage">
            <div data-role="header" data-theme="b" data-position="fixed">
                <h1>To Do List</h1>
                <a href="#formPage" onclick="newTask()" data-icon="plus" class="ui-btn-right">New</a>
            </div>

            <div data-role="content">
                <ul class="taskList" data-role="listview" data-theme="c" id="taskList">
                </ul>
            </div>
        </div>
        // ... lot‘s of stuff omitted
    </body>
</html>
jQuery Mobile
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name = "viewport" content = "initial-scale = 1.0, user-scalable = no">
        <title>To Do List</title>
        <script src="../../_libs/jqm/jquery-1.6.2.min.js"></script>
        <script src="../../_libs/jqm/jquery.mobile-1.0b3.min.js"></script>
        <script src="../../_libs/persistencejs/lib/persistence.js"></script>

        <link href="../../_libs/jqm/jquery.mobile-1.0b3.min.css" rel="stylesheet">
        <link href="../../_libs/jqm/jquery.mobile.datebox-1.0b1.min.css" rel="stylesheet">

        <script src="app.js"></script>
        <link rel="apple-touch-icon" href="icon.png"/>
        <link rel="apple-touch-startup-image" href="res/img/Default.png" />
    </head>
    <body>
        <!-- Index page-->
        <div data-role="page" id="indexPage">
            <div data-role="header" data-theme="b" data-position="fixed">
                                                                          Define a Page
                <h1>To Do List</h1>
                <a href="#formPage" onclick="newTask()" data-icon="plus" class="ui-btn-right">New</a>
            </div>

            <div data-role="content">
                <ul class="taskList" data-role="listview" data-theme="c" id="taskList">
                </ul>
            </div>
        </div>
        // ... lot‘s of stuff omitted
    </body>
</html>
jQuery Mobile
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name = "viewport" content = "initial-scale = 1.0, user-scalable = no">
        <title>To Do List</title>
        <script src="../../_libs/jqm/jquery-1.6.2.min.js"></script>
        <script src="../../_libs/jqm/jquery.mobile-1.0b3.min.js"></script>
        <script src="../../_libs/persistencejs/lib/persistence.js"></script>

        <link href="../../_libs/jqm/jquery.mobile-1.0b3.min.css" rel="stylesheet">
        <link href="../../_libs/jqm/jquery.mobile.datebox-1.0b1.min.css" rel="stylesheet">

        <script src="app.js"></script>
        <link rel="apple-touch-icon" href="icon.png"/>
        <link rel="apple-touch-startup-image" href="res/img/Default.png" />
    </head>
    <body>
        <!-- Index page-->
        <div data-role="page" id="indexPage">
            <div data-role="header" data-theme="b" data-position="fixed">
                <h1>To Do List</h1>
                                                                      Define Header
                <a href="#formPage" onclick="newTask()" data-icon="plus" class="ui-btn-right">New</a>
            </div>

            <div data-role="content">
                <ul class="taskList" data-role="listview" data-theme="c" id="taskList">
                </ul>
            </div>
        </div>
        // ... lot‘s of stuff omitted
    </body>
</html>
jQuery Mobile
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name = "viewport" content = "initial-scale = 1.0, user-scalable = no">
        <title>To Do List</title>
        <script src="../../_libs/jqm/jquery-1.6.2.min.js"></script>
        <script src="../../_libs/jqm/jquery.mobile-1.0b3.min.js"></script>
        <script src="../../_libs/persistencejs/lib/persistence.js"></script>

        <link href="../../_libs/jqm/jquery.mobile-1.0b3.min.css" rel="stylesheet">
        <link href="../../_libs/jqm/jquery.mobile.datebox-1.0b1.min.css" rel="stylesheet">

        <script src="app.js"></script>
        <link rel="apple-touch-icon" href="icon.png"/>
        <link rel="apple-touch-startup-image" href="res/img/Default.png" />
    </head>
    <body>
        <!-- Index page-->
        <div data-role="page" id="indexPage">
            <div data-role="header" data-theme="b" data-position="fixed">
                <h1>To Do List</h1>
                <a href="#formPage" onclick="newTask()" data-icon="plus" class="ui-btn-right">New</a>
            </div>

            <div data-role="content">
                                                                     Define Content
                <ul class="taskList" data-role="listview" data-theme="c" id="taskList">
                </ul>
            </div>
        </div>
        // ... lot‘s of stuff omitted
    </body>
</html>
jQuery Mobile
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name = "viewport" content = "initial-scale = 1.0, user-scalable = no">
        <title>To Do List</title>
        <script src="../../_libs/jqm/jquery-1.6.2.min.js"></script>
        <script src="../../_libs/jqm/jquery.mobile-1.0b3.min.js"></script>
        <script src="../../_libs/persistencejs/lib/persistence.js"></script>

        <link href="../../_libs/jqm/jquery.mobile-1.0b3.min.css" rel="stylesheet">
        <link href="../../_libs/jqm/jquery.mobile.datebox-1.0b1.min.css" rel="stylesheet">

        <script src="app.js"></script>
        <link rel="apple-touch-icon" href="icon.png"/>
        <link rel="apple-touch-startup-image" href="res/img/Default.png" />
    </head>
    <body>
        <!-- Index page-->
        <div data-role="page" id="indexPage">
            <div data-role="header" data-theme="b" data-position="fixed">
                <h1>To Do List</h1>
                <a href="#formPage" onclick="newTask()" data-icon="plus" class="ui-btn-right">New</a>
            </div>

            <div data-role="content">
                <ul class="taskList" data-role="listview" data-theme="c" id="taskList">
                </ul>
            </div>
        </div>
        // ... lot‘s of stuff omitted
    </body>
</html>
function save() {
    var id = $('#formPage').jqmData("id");
    if (id === null) {

       var task = {
           name: $("#taskName").val(),
           description: $("#taskDescription").val(),
           completed: ($("#taskCompleted").val() === "yes"),
           duedate: $("#taskDuedate").data("datebox").theDate
       };

       taskManager.addTask(task);
    }
    else {
        var currentTask = $("#formPage").jqmData("task");
        currentTask.name($("#taskName").val());
        currentTask.description($("#taskDescription").val());
        currentTask.completed(($("#taskCompleted").val() === "yes"));
        currentTask.duedate($("#taskDuedate").data("datebox").theDate);
        taskManager.save();
        $('#formPage').jqmData("id", null);
    }
}
Sencha Touch
<!DOCTYPE html>
<html manifest="todolist.manifest">
    <head>
        <meta charset="utf-8" />
        <meta name="apple-mobile-web-app-capable" content="yes" />

        <title>To Do List</title>

       <script src="../../_libs/sencha/sencha-touch.js"></script>
       <link href="../../_libs/sencha/resources/css/sencha-touch.css" rel="stylesheet">

       <link rel="stylesheet" href="style.css">
       <script src="app.js"></script>

        <link rel="apple-touch-icon" href="icon.png"/>
        <link rel="apple-touch-startup-image" href="res/img/Default.png" />

    </head>
    <body></body>
</html>
<!DOCTYPE html>
<html manifest="todolist.manifest">
    <head>
        <meta charset="utf-8" />
        <meta name="apple-mobile-web-app-capable" content="yes" />

        <title>To Do List</title>

       <script src="../../_libs/sencha/sencha-touch.js"></script>
       <link href="../../_libs/sencha/resources/css/sencha-touch.css" rel="stylesheet">

       <link rel="stylesheet" href="style.css">
       <script src="app.js"></script>

        <link rel="apple-touch-icon" href="icon.png"/>
        <link rel="apple-touch-startup-image" href="res/img/Default.png" />

    </head>
    <body></body>
</html>
                    Define Content (?)
var saveButton = {
      id: 'taskFormSaveButton',
      text: 'Save',
      ui: 'confirm',
      handler: function () {
        var record = TaskList.TaskForm.getRecord();
        TaskList.TaskForm.updateRecord(record);
        if (null === TaskList.taskStore.findRecord('id', record.id))
          {
             TaskList.taskStore.add(record);
          }
        TaskList.taskStore.sync();
        TaskList.taskStore.sort([{property: 'duedate',
                                   direction: 'ASC'}]);
        TaskList.listPanel.refresh();
        TaskList.Viewport.setActiveItem("mainlist", {type: "slide",
                                                 direction: "right"});
       },
       scope: this
   };
var titlebar = {
     id: 'taskFormTitlebar',
     xtype: 'toolbar',
     title: 'Task Detail',
     items: [ cancelButton, {xtype: 'spacer'},
              saveButton]
 };

TaskList.Viewport = new Ext.Panel({
     fullscreen: true,
     layout: "card",
     style: "background-color: white",
     layoutOnOrientationChange: true,
     items: [
         {
         id: "mainlist",
         xtype: "panel",
         layout: "card",
         items: TaskList.listPanel,
         dockedItems: toolbar
     }, TaskList.TaskForm]
 });
The HTML or
the JavaScript way?
Choose wisely
But is it native?
5
Native?
Native?
Native?

• Accelerometer
Native?

• Accelerometer
• Camera
Native?

• Accelerometer
• Camera
• Address Book
Native?

• Accelerometer
• Camera
• Address Book
• ...
  A lot is missing!
PhoneGap

• iOS, Android, Blackberry, Symbian, WebOS
• JavaScript APIs that give access to Phones
  features
• Native Libraries, that interface with the
  JavaScript API
             http://phonegap.com
•   Coordinates (Position Data / Acceleration)

•   Accelerometer

•   Camera

•   Contacts

•   Files / Directories / FileTransfer

•   Geolocation / Compass

•   Media

•   Notification (Dialogs / Alerts)

•   Orientation

•   SMS / Telephony

•   Connection
Accessing the camera

navigator.camera.getPicture(onSuccess, onFail, { quality: 50 });

function onSuccess(imageData) {
    var image = document.getElementById('myImage');
    image.src = "data:image/jpeg;base64," + imageData;
}

function onFail(message) {
    alert('Failed because: ' + message);
}
Write HTML / JS
run „native“ on device
access device functions
But we‘re still not
 „really“ native
6
Titanium Appcelerator



   http://www.appcelerator.com/
Objective-C / Dalvik
    JavaScript
      Bridge

iOS / Android / (BlackBerry)
Build applications with native components
Control them from JavaScript
   var
win
=
Ti.UI.createWindow();
   var
view
=
Ti.UI.createImageView({
   

image:"myimage.png",
   

width:24,
   

height:24
   });
   var
button
=
Ti.UI.createButton({
   

title:"Animate",
   

width:80,
   

height:40,
   

bottom:10
   });
   button.addEventListener("click",function(){
   

view.animate({top:0,duration:500});
   });
   win.add(view);
   win.add(button);
   win.open();
Conclusion
use normal Web App
• Leverage your HTML5 / CSS3 / JavaScript
• Webkit is the new IE (which „is a good
  thing“)
• No restrictions on content from a certain
  fruit company
• Can go offline
use jQuery Mobile

• most mobile web browsers
• simple to use, relatively low learning curve
• much HTML, some JavaScript
• still in beta (actually, RC1 just came out)
use Sencha Touch

• most mobile browsers
• many different components / widgets
• high learning curve
• commercial and open source licenses (but
  free)
use PhoneGap

• most mobile browsers
• supports „any“ web app (jQuery Mobile /
  Sencha)
• Access to some device functions
• Deliver „native“ app (via AppStore)
use Appcelerator
• iOS / Android „native“ native app
  (AppStore)
• use all native components of device
• high learning curve
• Commercial developer licenses, basic
  functionality free
Want to learn more?
http://mobile-training.ch
Taking your Web App for a walk

Contenu connexe

Tendances

Introduction to Jquery
Introduction to JqueryIntroduction to Jquery
Introduction to JqueryAmzad Hossain
 
Game Development Using HTML 5
Game Development Using HTML 5Game Development Using HTML 5
Game Development Using HTML 5osa_ora
 
HTML5: Markup Evolved
HTML5: Markup EvolvedHTML5: Markup Evolved
HTML5: Markup EvolvedBilly Hylton
 
HTML5 workshop, part 1
HTML5 workshop, part 1HTML5 workshop, part 1
HTML5 workshop, part 1Robert Nyman
 
High Performance Mobile (SF/SV Web Perf)
High Performance Mobile (SF/SV Web Perf)High Performance Mobile (SF/SV Web Perf)
High Performance Mobile (SF/SV Web Perf)Steve Souders
 
关于 Html5 那点事
关于 Html5 那点事关于 Html5 那点事
关于 Html5 那点事Sofish Lin
 
Design+Performance Velocity 2015
Design+Performance Velocity 2015Design+Performance Velocity 2015
Design+Performance Velocity 2015Steve Souders
 
Souders WPO Web2.0Expo
Souders WPO Web2.0ExpoSouders WPO Web2.0Expo
Souders WPO Web2.0Expoguest0b3d92d
 
JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)Steve Souders
 
High Performance HTML5 (SF HTML5 UG)
High Performance HTML5 (SF HTML5 UG)High Performance HTML5 (SF HTML5 UG)
High Performance HTML5 (SF HTML5 UG)Steve Souders
 
Dreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile designDreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile designDee Sadler
 
jQtouch, Building Awesome Webapps
jQtouch, Building Awesome WebappsjQtouch, Building Awesome Webapps
jQtouch, Building Awesome WebappsHome
 
jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009Ralph Whitbeck
 
HTML5 and the web of tomorrow!
HTML5  and the  web of tomorrow!HTML5  and the  web of tomorrow!
HTML5 and the web of tomorrow!Christian Heilmann
 
Prebrowsing - Velocity NY 2013
Prebrowsing - Velocity NY 2013Prebrowsing - Velocity NY 2013
Prebrowsing - Velocity NY 2013Steve Souders
 
Multimedia on the web - HTML5 video and audio
Multimedia on the web - HTML5 video and audioMultimedia on the web - HTML5 video and audio
Multimedia on the web - HTML5 video and audioChristian Heilmann
 
Html5的应用与推行
Html5的应用与推行Html5的应用与推行
Html5的应用与推行Sofish Lin
 
Taiwan Web Standards Talk 2011
Taiwan Web Standards Talk 2011Taiwan Web Standards Talk 2011
Taiwan Web Standards Talk 2011Zi Bin Cheah
 
High Performance Web Components
High Performance Web ComponentsHigh Performance Web Components
High Performance Web ComponentsSteve Souders
 

Tendances (20)

Introduction to Jquery
Introduction to JqueryIntroduction to Jquery
Introduction to Jquery
 
Game Development Using HTML 5
Game Development Using HTML 5Game Development Using HTML 5
Game Development Using HTML 5
 
HTML5: Markup Evolved
HTML5: Markup EvolvedHTML5: Markup Evolved
HTML5: Markup Evolved
 
HTML5 workshop, part 1
HTML5 workshop, part 1HTML5 workshop, part 1
HTML5 workshop, part 1
 
High Performance Mobile (SF/SV Web Perf)
High Performance Mobile (SF/SV Web Perf)High Performance Mobile (SF/SV Web Perf)
High Performance Mobile (SF/SV Web Perf)
 
关于 Html5 那点事
关于 Html5 那点事关于 Html5 那点事
关于 Html5 那点事
 
Design+Performance Velocity 2015
Design+Performance Velocity 2015Design+Performance Velocity 2015
Design+Performance Velocity 2015
 
Souders WPO Web2.0Expo
Souders WPO Web2.0ExpoSouders WPO Web2.0Expo
Souders WPO Web2.0Expo
 
JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)
 
High Performance HTML5 (SF HTML5 UG)
High Performance HTML5 (SF HTML5 UG)High Performance HTML5 (SF HTML5 UG)
High Performance HTML5 (SF HTML5 UG)
 
Dreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile designDreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile design
 
jQtouch, Building Awesome Webapps
jQtouch, Building Awesome WebappsjQtouch, Building Awesome Webapps
jQtouch, Building Awesome Webapps
 
jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009
 
HTML5 and the web of tomorrow!
HTML5  and the  web of tomorrow!HTML5  and the  web of tomorrow!
HTML5 and the web of tomorrow!
 
Prebrowsing - Velocity NY 2013
Prebrowsing - Velocity NY 2013Prebrowsing - Velocity NY 2013
Prebrowsing - Velocity NY 2013
 
Multimedia on the web - HTML5 video and audio
Multimedia on the web - HTML5 video and audioMultimedia on the web - HTML5 video and audio
Multimedia on the web - HTML5 video and audio
 
Html5的应用与推行
Html5的应用与推行Html5的应用与推行
Html5的应用与推行
 
Taiwan Web Standards Talk 2011
Taiwan Web Standards Talk 2011Taiwan Web Standards Talk 2011
Taiwan Web Standards Talk 2011
 
Fav
FavFav
Fav
 
High Performance Web Components
High Performance Web ComponentsHigh Performance Web Components
High Performance Web Components
 

En vedette (6)

Ruby Coding Dojo
Ruby Coding DojoRuby Coding Dojo
Ruby Coding Dojo
 
Html5 Primer
Html5 PrimerHtml5 Primer
Html5 Primer
 
Mobino at Webmondy Frankfurt, Mai 2011
Mobino at Webmondy Frankfurt, Mai 2011Mobino at Webmondy Frankfurt, Mai 2011
Mobino at Webmondy Frankfurt, Mai 2011
 
Architektur der kleinen Bausteine
Architektur der kleinen BausteineArchitektur der kleinen Bausteine
Architektur der kleinen Bausteine
 
SOLID Ruby, SOLID Rails
SOLID Ruby, SOLID RailsSOLID Ruby, SOLID Rails
SOLID Ruby, SOLID Rails
 
Testing distributed, complex web applications
Testing distributed, complex web applicationsTesting distributed, complex web applications
Testing distributed, complex web applications
 

Similaire à Taking your Web App for a walk

Attractive HTML5~開発者の視点から~
Attractive HTML5~開発者の視点から~Attractive HTML5~開発者の視点から~
Attractive HTML5~開発者の視点から~Sho Ito
 
HTML5 on Mobile
HTML5 on MobileHTML5 on Mobile
HTML5 on MobileAdam Lu
 
Offline strategies for HTML5 web applications - IPC12
Offline strategies for HTML5 web applications - IPC12Offline strategies for HTML5 web applications - IPC12
Offline strategies for HTML5 web applications - IPC12Stephan Hochdörfer
 
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyConsegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyFabio Akita
 
Build Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBuild Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBob Paulin
 
Developing web applications in 2010
Developing web applications in 2010Developing web applications in 2010
Developing web applications in 2010Ignacio Coloma
 
Toutch Jquery Mobile
Toutch Jquery MobileToutch Jquery Mobile
Toutch Jquery MobileJinlong He
 
Offline strategies for HTML5 web applications - pfCongres2012
Offline strategies for HTML5 web applications - pfCongres2012Offline strategies for HTML5 web applications - pfCongres2012
Offline strategies for HTML5 web applications - pfCongres2012Stephan Hochdörfer
 
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012crokitta
 
Building high performance web apps.
Building high performance web apps.Building high performance web apps.
Building high performance web apps.Arshak Movsisyan
 
Design Tips & Development with jQuery Mobile and PhoneGap
Design Tips & Development with jQuery Mobile and PhoneGapDesign Tips & Development with jQuery Mobile and PhoneGap
Design Tips & Development with jQuery Mobile and PhoneGapGO Ohtani
 
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...“Good design is obvious. Great design is transparent.” — How we use Bootstrap...
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...Roni Banerjee
 
Once Source to Rule Them All
Once Source to Rule Them AllOnce Source to Rule Them All
Once Source to Rule Them AllDavid Yeiser
 

Similaire à Taking your Web App for a walk (20)

Attractive HTML5~開発者の視点から~
Attractive HTML5~開発者の視点から~Attractive HTML5~開発者の視点から~
Attractive HTML5~開発者の視点から~
 
HTML5 on Mobile
HTML5 on MobileHTML5 on Mobile
HTML5 on Mobile
 
Web-Performance
Web-PerformanceWeb-Performance
Web-Performance
 
Offline strategies for HTML5 web applications - IPC12
Offline strategies for HTML5 web applications - IPC12Offline strategies for HTML5 web applications - IPC12
Offline strategies for HTML5 web applications - IPC12
 
HTML5와 모바일
HTML5와 모바일HTML5와 모바일
HTML5와 모바일
 
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyConsegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
 
Build Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBuild Your Own CMS with Apache Sling
Build Your Own CMS with Apache Sling
 
Developing web applications in 2010
Developing web applications in 2010Developing web applications in 2010
Developing web applications in 2010
 
Toutch Jquery Mobile
Toutch Jquery MobileToutch Jquery Mobile
Toutch Jquery Mobile
 
Offline strategies for HTML5 web applications - pfCongres2012
Offline strategies for HTML5 web applications - pfCongres2012Offline strategies for HTML5 web applications - pfCongres2012
Offline strategies for HTML5 web applications - pfCongres2012
 
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
 
Apex & jQuery Mobile
Apex & jQuery MobileApex & jQuery Mobile
Apex & jQuery Mobile
 
Building high performance web apps.
Building high performance web apps.Building high performance web apps.
Building high performance web apps.
 
Upload[1]
Upload[1]Upload[1]
Upload[1]
 
Xxx
XxxXxx
Xxx
 
Webpack
Webpack Webpack
Webpack
 
Design Tips & Development with jQuery Mobile and PhoneGap
Design Tips & Development with jQuery Mobile and PhoneGapDesign Tips & Development with jQuery Mobile and PhoneGap
Design Tips & Development with jQuery Mobile and PhoneGap
 
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...“Good design is obvious. Great design is transparent.” — How we use Bootstrap...
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...
 
Once Source to Rule Them All
Once Source to Rule Them AllOnce Source to Rule Them All
Once Source to Rule Them All
 
jQuery
jQueryjQuery
jQuery
 

Dernier

Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Dernier (20)

Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

Taking your Web App for a walk

  • 1. Taking your web app for a walk Jens-Christian Fischer soft-shake.ch 3.10.2011
  • 3. So who‘s this guy? • I have a job: Developer & CEO
  • 4. So who‘s this guy? • I have a job: Developer & CEO • I have a company: http://invisible.ch
  • 5. So who‘s this guy? • I have a job: Developer & CEO • I have a company: http://invisible.ch • I have an email address: jens-christian@invisible.ch
  • 6. So who‘s this guy? • I have a job: Developer & CEO • I have a company: http://invisible.ch • I have an email address: jens-christian@invisible.ch • I‘m on Twitter: @jcfischer
  • 7. So who‘s this guy? • I have a job: Developer & CEO • I have a company: http://invisible.ch • I have an email address: jens-christian@invisible.ch • I‘m on Twitter: @jcfischer • I‘m on Google+: 109789939743085010576
  • 10.
  • 11. iO S -C oid i ve A n dr c t b je Da O Win Ph lvi one7 Bl k ac C# kb O S er W eb ry IP ?) (R
  • 12. What are we going to do?
  • 13. What are we going to do?
  • 14.
  • 15. 6 Steps towards mobile apps
  • 16. 6 Steps towards mobile apps 1. HTML 5 / CSS 3
  • 17. 6 Steps towards mobile apps 1. HTML 5 / CSS 3 2. Responsive Design
  • 18. 6 Steps towards mobile apps 1. HTML 5 / CSS 3 2. Responsive Design 3. Offline / Local Storage
  • 19. 6 Steps towards mobile apps 1. HTML 5 / CSS 3 2. Responsive Design 3. Offline / Local Storage 4. UI Frameworks (jQuery Mobile / Sencha)
  • 20. 6 Steps towards mobile apps 1. HTML 5 / CSS 3 2. Responsive Design 3. Offline / Local Storage 4. UI Frameworks (jQuery Mobile / Sencha) 5. Using the device (PhoneGap)
  • 21. 6 Steps towards mobile apps 1. HTML 5 / CSS 3 2. Responsive Design 3. Offline / Local Storage 4. UI Frameworks (jQuery Mobile / Sencha) 5. Using the device (PhoneGap) 6. Being Native (Titanium)
  • 22. 6 Steps towards mobile apps 1. HTML 5 / CSS 3 2. Responsive Design 3. Offline / Local Storage 4. UI Frameworks (jQuery Mobile / Se 5. Using the device (PhoneGap) 6. Being Native (Titanium)
  • 23. 1
  • 24. CSS
  • 26. 2
  • 29. CSS Media Queries @media handheld, only screen and (max-width: 1280px) { .wrapper { padding: 0; } #header { position: absolute; } #header .center { position: relative; width: 100%; } #logo { margin: 0; left: 32px; top: 8px; } #content { width: 100%; margin: 0 auto; padding: 154px 0 240px 0; } #footer { position: absolute; bottom: 0; left: 0; } } @media handheld, only screen and (max-width: 768px) { .wrapper { padding: 0; } .entry { margin-left: 0; } h1 { font-size: 1.3em; } #logo { left: 8px; top: 8px; } #useless { display: none; } #panel { display: none; } #content { padding: 154px 0 240px 0; width: 100%; height: 100%; } #footer { position: absolute; max-width: 768px; bottom: 0; left: 0; } .text { margin: 0; } } @media handheld, only screen and (max-width: 480px) { .left { float: none; margin: 0 0 0 86px; } } @media handheld, only screen and (max-width: 320px) { .left { margin: 0 0 0 8px; } }
  • 31. 3
  • 32. Going Offline • Caching Files offline • Local Storage
  • 33. Cache Manifest <!DOCTYPE HTML> CACHE MANIFEST <html manifest="/cache.manifest"> FALLBACK: <body> / /offline.html ... NETWORK: </body> /tracking.cgi </html> CACHE: /clock.css /clock.js /clock-face.jpg http://diveintohtml5.org/offline.html
  • 34. Cache Manifest CACHE MANIFEST FALLBACK: / /offline.html NETWORK: /tracking.cgi CACHE: /clock.css /clock.js /clock-face.jpg http://diveintohtml5.org/offline.html
  • 35. Cache Manifest CACHE MANIFEST FALLBACK: / /offline.html If not cached, show this NETWORK: /tracking.cgi CACHE: /clock.css /clock.js /clock-face.jpg http://diveintohtml5.org/offline.html
  • 36. Cache Manifest CACHE MANIFEST FALLBACK: / /offline.html If not cached, show this NETWORK: /tracking.cgi Dont‘t cache CACHE: /clock.css /clock.js /clock-face.jpg http://diveintohtml5.org/offline.html
  • 37. Cache Manifest CACHE MANIFEST FALLBACK: / /offline.html If not cached, show this NETWORK: /tracking.cgi Dont‘t cache CACHE: /clock.css /clock.js Cache these files /clock-face.jpg http://diveintohtml5.org/offline.html
  • 38. Local Storage Simple Key - Value store if (Modernizr.localstorage) { var foo = localStorage.getItem("key"); // ... localStorage.setItem("key", foo); } else { alert('No storage capabilities'); } http://diveintohtml5.org/storage.html
  • 40. More than Key-Value? Web SQL Indexed DB
  • 41. More than Key-Value? Web SQL Indexed DB
  • 42. More than Key-Value? Web SQL Indexed DB hic sunt dracones
  • 44. how far have we come? http://flickr.com/photos/glennharper/49536169/
  • 45. 4
  • 46.
  • 47.
  • 48. jQuery Mobile • Shares the name with jQuery (and uses it) • HTML Code with annotations • JavaScript for functionality http://jquerymobile.com
  • 49. Sencha Touch • Grown out of the Ext JS Framework • JavaScript Code for design • HTML is just a container http://www.sencha.com/products/touch/
  • 50.
  • 52. jQuery Mobile <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name = "viewport" content = "initial-scale = 1.0, user-scalable = no"> <title>To Do List</title> <script src="../../_libs/jqm/jquery-1.6.2.min.js"></script> <script src="../../_libs/jqm/jquery.mobile-1.0b3.min.js"></script> <script src="../../_libs/persistencejs/lib/persistence.js"></script> <link href="../../_libs/jqm/jquery.mobile-1.0b3.min.css" rel="stylesheet"> <link href="../../_libs/jqm/jquery.mobile.datebox-1.0b1.min.css" rel="stylesheet"> <script src="app.js"></script> <link rel="apple-touch-icon" href="icon.png"/> <link rel="apple-touch-startup-image" href="res/img/Default.png" /> </head> <body> <!-- Index page--> <div data-role="page" id="indexPage"> <div data-role="header" data-theme="b" data-position="fixed"> <h1>To Do List</h1> <a href="#formPage" onclick="newTask()" data-icon="plus" class="ui-btn-right">New</a> </div> <div data-role="content"> <ul class="taskList" data-role="listview" data-theme="c" id="taskList"> </ul> </div> </div> // ... lot‘s of stuff omitted </body> </html>
  • 53. jQuery Mobile <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name = "viewport" content = "initial-scale = 1.0, user-scalable = no"> <title>To Do List</title> <script src="../../_libs/jqm/jquery-1.6.2.min.js"></script> <script src="../../_libs/jqm/jquery.mobile-1.0b3.min.js"></script> <script src="../../_libs/persistencejs/lib/persistence.js"></script> <link href="../../_libs/jqm/jquery.mobile-1.0b3.min.css" rel="stylesheet"> <link href="../../_libs/jqm/jquery.mobile.datebox-1.0b1.min.css" rel="stylesheet"> <script src="app.js"></script> <link rel="apple-touch-icon" href="icon.png"/> <link rel="apple-touch-startup-image" href="res/img/Default.png" /> </head> <body> <!-- Index page--> <div data-role="page" id="indexPage"> <div data-role="header" data-theme="b" data-position="fixed"> Define a Page <h1>To Do List</h1> <a href="#formPage" onclick="newTask()" data-icon="plus" class="ui-btn-right">New</a> </div> <div data-role="content"> <ul class="taskList" data-role="listview" data-theme="c" id="taskList"> </ul> </div> </div> // ... lot‘s of stuff omitted </body> </html>
  • 54. jQuery Mobile <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name = "viewport" content = "initial-scale = 1.0, user-scalable = no"> <title>To Do List</title> <script src="../../_libs/jqm/jquery-1.6.2.min.js"></script> <script src="../../_libs/jqm/jquery.mobile-1.0b3.min.js"></script> <script src="../../_libs/persistencejs/lib/persistence.js"></script> <link href="../../_libs/jqm/jquery.mobile-1.0b3.min.css" rel="stylesheet"> <link href="../../_libs/jqm/jquery.mobile.datebox-1.0b1.min.css" rel="stylesheet"> <script src="app.js"></script> <link rel="apple-touch-icon" href="icon.png"/> <link rel="apple-touch-startup-image" href="res/img/Default.png" /> </head> <body> <!-- Index page--> <div data-role="page" id="indexPage"> <div data-role="header" data-theme="b" data-position="fixed"> <h1>To Do List</h1> Define Header <a href="#formPage" onclick="newTask()" data-icon="plus" class="ui-btn-right">New</a> </div> <div data-role="content"> <ul class="taskList" data-role="listview" data-theme="c" id="taskList"> </ul> </div> </div> // ... lot‘s of stuff omitted </body> </html>
  • 55. jQuery Mobile <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name = "viewport" content = "initial-scale = 1.0, user-scalable = no"> <title>To Do List</title> <script src="../../_libs/jqm/jquery-1.6.2.min.js"></script> <script src="../../_libs/jqm/jquery.mobile-1.0b3.min.js"></script> <script src="../../_libs/persistencejs/lib/persistence.js"></script> <link href="../../_libs/jqm/jquery.mobile-1.0b3.min.css" rel="stylesheet"> <link href="../../_libs/jqm/jquery.mobile.datebox-1.0b1.min.css" rel="stylesheet"> <script src="app.js"></script> <link rel="apple-touch-icon" href="icon.png"/> <link rel="apple-touch-startup-image" href="res/img/Default.png" /> </head> <body> <!-- Index page--> <div data-role="page" id="indexPage"> <div data-role="header" data-theme="b" data-position="fixed"> <h1>To Do List</h1> <a href="#formPage" onclick="newTask()" data-icon="plus" class="ui-btn-right">New</a> </div> <div data-role="content"> Define Content <ul class="taskList" data-role="listview" data-theme="c" id="taskList"> </ul> </div> </div> // ... lot‘s of stuff omitted </body> </html>
  • 56. jQuery Mobile <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name = "viewport" content = "initial-scale = 1.0, user-scalable = no"> <title>To Do List</title> <script src="../../_libs/jqm/jquery-1.6.2.min.js"></script> <script src="../../_libs/jqm/jquery.mobile-1.0b3.min.js"></script> <script src="../../_libs/persistencejs/lib/persistence.js"></script> <link href="../../_libs/jqm/jquery.mobile-1.0b3.min.css" rel="stylesheet"> <link href="../../_libs/jqm/jquery.mobile.datebox-1.0b1.min.css" rel="stylesheet"> <script src="app.js"></script> <link rel="apple-touch-icon" href="icon.png"/> <link rel="apple-touch-startup-image" href="res/img/Default.png" /> </head> <body> <!-- Index page--> <div data-role="page" id="indexPage"> <div data-role="header" data-theme="b" data-position="fixed"> <h1>To Do List</h1> <a href="#formPage" onclick="newTask()" data-icon="plus" class="ui-btn-right">New</a> </div> <div data-role="content"> <ul class="taskList" data-role="listview" data-theme="c" id="taskList"> </ul> </div> </div> // ... lot‘s of stuff omitted </body> </html>
  • 57. function save() { var id = $('#formPage').jqmData("id"); if (id === null) { var task = { name: $("#taskName").val(), description: $("#taskDescription").val(), completed: ($("#taskCompleted").val() === "yes"), duedate: $("#taskDuedate").data("datebox").theDate }; taskManager.addTask(task); } else { var currentTask = $("#formPage").jqmData("task"); currentTask.name($("#taskName").val()); currentTask.description($("#taskDescription").val()); currentTask.completed(($("#taskCompleted").val() === "yes")); currentTask.duedate($("#taskDuedate").data("datebox").theDate); taskManager.save(); $('#formPage').jqmData("id", null); } }
  • 59. <!DOCTYPE html> <html manifest="todolist.manifest"> <head> <meta charset="utf-8" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <title>To Do List</title> <script src="../../_libs/sencha/sencha-touch.js"></script> <link href="../../_libs/sencha/resources/css/sencha-touch.css" rel="stylesheet"> <link rel="stylesheet" href="style.css"> <script src="app.js"></script> <link rel="apple-touch-icon" href="icon.png"/> <link rel="apple-touch-startup-image" href="res/img/Default.png" /> </head> <body></body> </html>
  • 60. <!DOCTYPE html> <html manifest="todolist.manifest"> <head> <meta charset="utf-8" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <title>To Do List</title> <script src="../../_libs/sencha/sencha-touch.js"></script> <link href="../../_libs/sencha/resources/css/sencha-touch.css" rel="stylesheet"> <link rel="stylesheet" href="style.css"> <script src="app.js"></script> <link rel="apple-touch-icon" href="icon.png"/> <link rel="apple-touch-startup-image" href="res/img/Default.png" /> </head> <body></body> </html> Define Content (?)
  • 61. var saveButton = { id: 'taskFormSaveButton', text: 'Save', ui: 'confirm', handler: function () { var record = TaskList.TaskForm.getRecord(); TaskList.TaskForm.updateRecord(record); if (null === TaskList.taskStore.findRecord('id', record.id)) { TaskList.taskStore.add(record); } TaskList.taskStore.sync(); TaskList.taskStore.sort([{property: 'duedate', direction: 'ASC'}]); TaskList.listPanel.refresh(); TaskList.Viewport.setActiveItem("mainlist", {type: "slide", direction: "right"}); }, scope: this };
  • 62. var titlebar = { id: 'taskFormTitlebar', xtype: 'toolbar', title: 'Task Detail', items: [ cancelButton, {xtype: 'spacer'}, saveButton] }; TaskList.Viewport = new Ext.Panel({ fullscreen: true, layout: "card", style: "background-color: white", layoutOnOrientationChange: true, items: [ { id: "mainlist", xtype: "panel", layout: "card", items: TaskList.listPanel, dockedItems: toolbar }, TaskList.TaskForm] });
  • 63.
  • 64. The HTML or the JavaScript way?
  • 66. But is it native?
  • 67. 5
  • 73. Native? • Accelerometer • Camera • Address Book • ... A lot is missing!
  • 74. PhoneGap • iOS, Android, Blackberry, Symbian, WebOS • JavaScript APIs that give access to Phones features • Native Libraries, that interface with the JavaScript API http://phonegap.com
  • 75. Coordinates (Position Data / Acceleration) • Accelerometer • Camera • Contacts • Files / Directories / FileTransfer • Geolocation / Compass • Media • Notification (Dialogs / Alerts) • Orientation • SMS / Telephony • Connection
  • 76. Accessing the camera navigator.camera.getPicture(onSuccess, onFail, { quality: 50 }); function onSuccess(imageData) { var image = document.getElementById('myImage'); image.src = "data:image/jpeg;base64," + imageData; } function onFail(message) { alert('Failed because: ' + message); }
  • 77. Write HTML / JS run „native“ on device access device functions
  • 78. But we‘re still not „really“ native
  • 79.
  • 80. 6
  • 81. Titanium Appcelerator http://www.appcelerator.com/
  • 82. Objective-C / Dalvik JavaScript Bridge iOS / Android / (BlackBerry)
  • 83. Build applications with native components Control them from JavaScript var
win
=
Ti.UI.createWindow(); var
view
=
Ti.UI.createImageView({ 

image:"myimage.png", 

width:24, 

height:24 }); var
button
=
Ti.UI.createButton({ 

title:"Animate", 

width:80, 

height:40, 

bottom:10 }); button.addEventListener("click",function(){ 

view.animate({top:0,duration:500}); }); win.add(view); win.add(button); win.open();
  • 84.
  • 86. use normal Web App • Leverage your HTML5 / CSS3 / JavaScript • Webkit is the new IE (which „is a good thing“) • No restrictions on content from a certain fruit company • Can go offline
  • 87. use jQuery Mobile • most mobile web browsers • simple to use, relatively low learning curve • much HTML, some JavaScript • still in beta (actually, RC1 just came out)
  • 88. use Sencha Touch • most mobile browsers • many different components / widgets • high learning curve • commercial and open source licenses (but free)
  • 89. use PhoneGap • most mobile browsers • supports „any“ web app (jQuery Mobile / Sencha) • Access to some device functions • Deliver „native“ app (via AppStore)
  • 90. use Appcelerator • iOS / Android „native“ native app (AppStore) • use all native components of device • high learning curve • Commercial developer licenses, basic functionality free
  • 91. Want to learn more?

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. \n