SlideShare a Scribd company logo
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/
Taking your Web App for a walk
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?
Taking your Web App for a walk
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
Taking your Web App for a walk
Taking your Web App for a walk
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/
Taking your Web App for a walk
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]
 });
Taking your Web App for a walk
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
Taking your Web App for a walk
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();
Taking your Web App for a walk
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

More Related Content

PDF
jQuery UI and Plugins
PDF
You too can be a bedwetting antfucker: Bruce Lawson, Opera, Fronteers 2011
PDF
Real World Web Standards
PDF
Fisl 11 - Dicas de Desenvolvimento Web com Ruby
PDF
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
PDF
State of jQuery '09
PDF
[jqconatx] Adaptive Images for Responsive Web Design
PDF
Accessibility - A feature you can build
jQuery UI and Plugins
You too can be a bedwetting antfucker: Bruce Lawson, Opera, Fronteers 2011
Real World Web Standards
Fisl 11 - Dicas de Desenvolvimento Web com Ruby
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
State of jQuery '09
[jqconatx] Adaptive Images for Responsive Web Design
Accessibility - A feature you can build

What's hot (20)

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

Viewers also liked (6)

PDF
Ruby Coding Dojo
KEY
Html5 Primer
KEY
Mobino at Webmondy Frankfurt, Mai 2011
PDF
Architektur der kleinen Bausteine
KEY
SOLID Ruby, SOLID Rails
PDF
Testing distributed, complex web applications
Ruby Coding Dojo
Html5 Primer
Mobino at Webmondy Frankfurt, Mai 2011
Architektur der kleinen Bausteine
SOLID Ruby, SOLID Rails
Testing distributed, complex web applications
Ad

Similar to Taking your Web App for a walk (20)

PDF
Attractive HTML5~開発者の視点から~
PPTX
HTML5 on Mobile
PDF
Web-Performance
PDF
Offline strategies for HTML5 web applications - IPC12
KEY
HTML5와 모바일
PDF
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
PPT
Build Your Own CMS with Apache Sling
PDF
Developing web applications in 2010
PDF
Toutch Jquery Mobile
PDF
Offline strategies for HTML5 web applications - pfCongres2012
PPTX
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
PPTX
Apex & jQuery Mobile
PPTX
Building high performance web apps.
TXT
TXT
Xxx
PDF
ZIP
Design Tips & Development with jQuery Mobile and PhoneGap
DOCX
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...
PDF
Once Source to Rule Them All
PPTX
Attractive HTML5~開発者の視点から~
HTML5 on Mobile
Web-Performance
Offline strategies for HTML5 web applications - IPC12
HTML5와 모바일
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
Build Your Own CMS with Apache Sling
Developing web applications in 2010
Toutch Jquery Mobile
Offline strategies for HTML5 web applications - pfCongres2012
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
Apex & jQuery Mobile
Building high performance web apps.
Xxx
Design Tips & Development with jQuery Mobile and PhoneGap
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...
Once Source to Rule Them All

Recently uploaded (20)

PPTX
Spectroscopy.pptx food analysis technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Big Data Technologies - Introduction.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
KodekX | Application Modernization Development
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Spectroscopy.pptx food analysis technology
Building Integrated photovoltaic BIPV_UPV.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Dropbox Q2 2025 Financial Results & Investor Presentation
Big Data Technologies - Introduction.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
KodekX | Application Modernization Development
Understanding_Digital_Forensics_Presentation.pptx
cuic standard and advanced reporting.pdf
Machine learning based COVID-19 study performance prediction
NewMind AI Weekly Chronicles - August'25 Week I
The Rise and Fall of 3GPP – Time for a Sabbatical?
20250228 LYD VKU AI Blended-Learning.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

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
  • 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?
  • 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
  • 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/
  • 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] });
  • 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
  • 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();
  • 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?

Editor's Notes