SlideShare une entreprise Scribd logo
1  sur  32
Télécharger pour lire hors ligne
Web App Vs Web Site

             Some tricks of the trade

                                                           Laurent Hasson
                                                    @ldhasson, lhasson@rim.com
                                      Technical Director, BlackBerry Web Platform



2012-05-09          Web Apps Vs. Web Sites                                          1
INTRODUCTION

2012-05-09      Web Apps Vs. Web Sites   2
Web App Or Web Site?
• Lots of controversies and differing opinions from very smart
  people on the Web
      – Should a mobile Web app be more Weby, or more Appy?


• My take: users today are conditioned to the App Life Cycle
      –      Download something
      –      Install something
      –      Have an icon on the home screen
      –      The App takes the entire screen real estate
      –      The App is integrated with the device


• But users really don’t care how the app was built!!!
      – So use Web technologies for the job!!

2012-05-09                           Web Apps Vs. Web Sites      3
Two Dimensions to App Experience


Life Cycle




                     There are many options to make the journey




                                         Contents


2012-05-09      Web Apps Vs. Web Sites                            4
Two Dimensions to App Experience


Life Cycle




                                         Contents


2012-05-09      Web Apps Vs. Web Sites              5
Say no to NIBS
                                          - The “Native Is Better” crowd are
                                            missing the point of the Web
                                                 - It’s the scale of the market stupid!
                                                 - It’s powerful, cross-platform, and an
                                                   abundant skill set.




NIBS
                                          - This is not to say that Web is better
                                            than Native
                                                 - That would be silly
                                          - But the Web is absolutely
                                            competitive
                                                 - Most types of apps can now be built
                                                   very nicely using Web technologies
                                                 - The gap is narrow today, keeps on
                                                   getting narrower, and fast.
                                          - Make no mistake
     * Native Is Better Syndrome
                                                 - Native is the competition to Web


2012-05-09                         Web Apps Vs. Web Sites                                  6
Web App Design Goals
• Single-page app metaphor
      – DOM manipulation for panels
      – And if not, mask page loading transitions
• Lack of browser chrome
      – Links, Bookmarks and Back
• Browser Events
      – Targeting multiple platforms means managing touches
        and clicks equally
• Viewport Management
      – Horizontal bounciness is bad
      – Zooming can be dangerous

2012-05-09                 Web Apps Vs. Web Sites         7
VIEWPORT

2012-05-09         Web Apps Vs. Web Sites   8
When a pixel is no longer a pixel
• The desktop viewport is WYSIWYG
      – Window dimensions are well known
• On mobile, it’s a whole other story
      – What you see is a viewport on a larger “thing”
             • Panning is a fact of life for most users
             • Zooming is a critical part of the browser UX
• And pixels are no longer display-relevant
      – High DPI and other display technologies have
        changed the meaning of what a pixel is
      – Better res without breaking the Web

2012-05-09                      Web Apps Vs. Web Sites        9
CSS Pixels
• These are the pixels we deal with everyday
      – CSS definitions
      – Inline dimensions in HTML
      – Media queries
• On desktop, a CSS px == 1 device px
• On mobile, don’t even try
      – The device vendor decides what the mapping is
      – You typically can’t tell programmatically what the ratio
        is
      – So deal with those abstract pixels
             • On BlackBerry, default is 160DPI


2012-05-09                       Web Apps Vs. Web Sites       10
HUH?

2012-05-09     Web Apps Vs. Web Sites   11
How many Pixel?
• screen.width/height
      – Device pixels
      – Entire screen, pretty useless as it’s really a desktop concept

• document.documentElement.clientWidth/clientHeight
      – CSS pixels: 768px (usable space, minus browser chrome, so height is different)
      – Useful for media queries

• window.innerWidth/innerHeight
      – CSS Pixels of viewport: Depending on zoom level
      – DPI-scaled: 350px width (native res scaled to 160dpi for zoom-level of 1)

• window.pageXOffset/pageYOffset
      – CSS Pixels of scrolling




2012-05-09
12                                       Web Apps Vs. Web Sites
Viewport and Media Queries
<meta name="viewport"
      content="height=device-height, width=device-width,
               initial-scale=1.0, maximum-scale=1.0,
               user-scalable=0">
      – Makes sure your page doesn’t flow beyond screen dimensions
        (including margins and borders)
      – Works as long as your content doesn’t force overflow
      – Deal in %


• @media all and (max-width: 480px) { … }
      – There are other flexible syntaxes for CSS media queries




2012-05-09                       Web Apps Vs. Web Sites              13
Orientation: Landscape or Portrait
• Make sure you test in both modes
• Or lock the orientation
      – There are configuration flags available through packagers
        such as Apache Cordova
• Upcoming ScreenOrientation API
      – screen.orientation=“portrait”|”landscape”|…,
        screen.lockOrientation(“…”), screen.unlockOrientation(),
        screen.onOrientationChange
      – Languishing…




2012-05-09                  Web Apps Vs. Web Sites                  14
EVENTS: TOUCHES, CLICKS…
2012-05-09       Web Apps Vs. Web Sites   15
World Wide Web == Wild Wild West
• Some platforms do touch well
• Others simulate clicks
      – With delays and quirks
• Behaviors expected when preventDefault() are
  not consistent
• Plus, you may want to create Web content
  that also works in a browser
      – That’s still an important goal if it makes sense to
        you

2012-05-09                Web Apps Vs. Web Sites              16
Your mileage may vary
                        TouchStart
                                     If nothing else within 300ms
                                                                    MouseDown


      TouchMove
                                                            MouseMove


                                                        MouseUp
             TouchEnd
                                                                          MouseClick

  • Delay is not the same everywhere
  • The interplay between touch and mouse events vary
  • The effect of onPreventDetault() vary



2012-05-09                             Web Apps Vs. Web Sites                          17
The Infamous Delay
• When the browser gets a touch, it needs to
  wait to see if there is a move or not
      – Some of the browser’s own UX for pan/zoom need
        that
      – Typically 300ms
• In your app, you should take control of that
      – You typically don’t want zooming gestures
      – You know what you expect from your users
      – You don’t want that 300ms delay


2012-05-09              Web Apps Vs. Web Sites       18
touch-event-mode: BlackBerry Only 
<meta name="touch-event-                     <meta name="touch-event-
   mode” content="native">                      mode" content=”pure-with-
                                                mouse-conversion">
• WebPage gets TouchEvents
  only from touch screen.                    • WebPage gets both Touch
                                               events and Mouse events.
                                                         User touches screen
 User touches screen

                                                                    Touch
             Touch

                                                                  onTouch      Y
                                                                   XXX?

   DONE                                                            N               DONE

                                                                   Mouse

Browser UX disabled: DoubleTap zoom, pinch zoom, text selection and context menus

2012-05-09                      Web Apps Vs. Web Sites                                    19
Control Your Destiny

                        TouchStart



                                           MouseDown


      TouchMove
                                                        MouseMove


                                                     MouseUp
             TouchEnd                                               MouseClick




2012-05-09                           Web Apps Vs. Web Sites                 20
Yeah, i know, it’s a bit controversial
2012-05-09                 Web Apps Vs. Web Sites     21
Custom Event Handling
if (Touch)
 {
   document.ontouchend = function(event)
    {
                                               Blocks Browser UX behaviors
      event.preventDefault();
      var e = event.target;
                                            You may have to walk up the parent
      while (e && !e.click)                nodes to find an actual click() handler.
       e = e.parentNode;
                                             Convert touch coordinates to click
      if (!e || !e.click)                               coordinates
       return;
      event.clientX = event.changedTouches[0].pageX;
      event.clientY = event.changedTouches[0].pageY;
      e.click(event);
    }                                           Invoke the onClick handler

 }


  You may want to do things differently to suit your app requirements, but the core idea is here


2012-05-09                              Web Apps Vs. Web Sites                                     22
Other virtual events systems
• Maps deviceOrientation events to key events
      – Simulates up/down/left/right arrows, or WASD or
        whatever
      – Most virtual keyboards don’t have arrow keys
      – Most virtual keyboards wouldn’t make sense in
        games anyways
      – Redirects to onKeyUp

• Famous frameworks, such as jQueryMobile,
  do it too, to gain control of, and unify, events.

2012-05-09              Web Apps Vs. Web Sites            23
user-select
• There is one more browser UX you may want to
  disable as well
      – User selection can be very annoying when in an app

      body {
             user-select: none;
        }



• Or do that on selected sub-DOMs of your app
• In some cases, it makes sense, and you want to
  reuse the browser mechanisms for that

2012-05-09                        Web Apps Vs. Web Sites     24
NO BROWSER CHROME
2012-05-09      Web Apps Vs. Web Sites   25
Arguably, the Web is about Navigation
• You don’t realize how much the Browser’s skin
  does with your site until you don’t have it
  anymore
• So many sites can still paint you into a corner
  where you can’t escape without the back
  button
      – Even some big sites do it (I won’t name names!)
• How about navigation
      – Many APIs exist now, and are well supported to
        help you.

2012-05-09               Web Apps Vs. Web Sites           26
Bookmarks == saved application states
• Why wouldn’t you let your users create in-app
  bookmarks for content they specially like?
• Doing an App now doesn’t mean you have to
  forget about REST principles and what has
  made the Web so cool!
• You need
      – The History API
      – Local storage
      – Some UI to let your users manage their
        “bookmarks”

2012-05-09               Web Apps Vs. Web Sites   27
And for debugging?




             location.reload(true)




2012-05-09        Web Apps Vs. Web Sites   28
CONCLUSION

2012-05-09      Web Apps Vs. Web Sites   29
Web Apps <> Web Sites
• If you subscribe to the idea that Web apps must
  be Appy, then do things a bit differently
      – Viewport management must be explicit
      – Manage your own events
      – Navigation is different due to lack of chrome
• But don’t drop what makes the web so cool
      – Navigation and Bookmarks are powerful features
• And debugging is hard, unless you do it on a
  BlackBerry
      – Best mobile browser AND built-in full remote
        WebInspector

2012-05-09                 Web Apps Vs. Web Sites        30
The End – Thank You
2012-05-09        Web Apps Vs. Web Sites   31
References
Slide 2: The Matrix (1999)
Slide 5: BlackBerry Loves Apache Cordova
Slide 8: Poltergeist (1982)
Slide 11: Videodrome (1983)
Slide 15: Nightmare On Elm Street (1984)
Slide 21: Hellraiser (1987)
Slide 25: Tetsuo (1989)
Slide 29: Anguish (1987)
Slide 31: Masters Of Horror: Family (2006)




2012-05-09                Web Apps Vs. Web Sites   32

Contenu connexe

Tendances

Mobile web vs. native apps: It's not about technology, it's about psychology
Mobile web vs. native apps: It's not about technology, it's about psychologyMobile web vs. native apps: It's not about technology, it's about psychology
Mobile web vs. native apps: It's not about technology, it's about psychologyiQcontent
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web DesignJulia Vi
 
Responsive Design & Beyond [Code & Creativity Workshop]
Responsive Design & Beyond [Code & Creativity Workshop]Responsive Design & Beyond [Code & Creativity Workshop]
Responsive Design & Beyond [Code & Creativity Workshop]Aaron Gustafson
 
Native Device vs. Mobile Web Applications
Native Device vs. Mobile Web ApplicationsNative Device vs. Mobile Web Applications
Native Device vs. Mobile Web ApplicationsTim Wright
 
Information Architecture in Mobile
Information Architecture in MobileInformation Architecture in Mobile
Information Architecture in MobileLazar Petrakiev
 
Getting Down & Dirty with Responsive Web Design
Getting Down & Dirty with Responsive Web DesignGetting Down & Dirty with Responsive Web Design
Getting Down & Dirty with Responsive Web Designmartinridgway
 
Responsive Web Design: Advantages & Best Practice - Darrin Adams, Cantarus
Responsive Web Design: Advantages & Best Practice - Darrin Adams, CantarusResponsive Web Design: Advantages & Best Practice - Darrin Adams, Cantarus
Responsive Web Design: Advantages & Best Practice - Darrin Adams, CantarusInternet World
 
Responsive Web Design - Advantages and Best Practice for Sports Direct
Responsive Web Design - Advantages and Best Practice for Sports DirectResponsive Web Design - Advantages and Best Practice for Sports Direct
Responsive Web Design - Advantages and Best Practice for Sports DirectCantarus
 
Is the Browser a Transitional Technology?
Is the Browser a Transitional Technology?Is the Browser a Transitional Technology?
Is the Browser a Transitional Technology?Allen Wirfs-Brock
 
Mobile Web (R)Evolution - Sept 2011
Mobile Web (R)Evolution - Sept 2011Mobile Web (R)Evolution - Sept 2011
Mobile Web (R)Evolution - Sept 2011arendsf
 
Sitepen Getting There From Here
Sitepen   Getting There From HereSitepen   Getting There From Here
Sitepen Getting There From HereGeorge Ang
 
Will apps replace the web? (or, why webhub.mobi?) - 6.8.2012
Will apps replace the web? (or, why webhub.mobi?) - 6.8.2012Will apps replace the web? (or, why webhub.mobi?) - 6.8.2012
Will apps replace the web? (or, why webhub.mobi?) - 6.8.2012www.webhub.mobi by Yuvee, Inc.
 
Driving Mobile Traffic: SEO
 Driving Mobile Traffic: SEO Driving Mobile Traffic: SEO
Driving Mobile Traffic: SEOpromediacorp
 
Building mobile website with Joomla - Joomla!Days NL 2010 #jd10nl
Building mobile website with Joomla -  Joomla!Days NL 2010 #jd10nlBuilding mobile website with Joomla -  Joomla!Days NL 2010 #jd10nl
Building mobile website with Joomla - Joomla!Days NL 2010 #jd10nlJoomla!Days Netherlands
 
Mobile Breakfast Briefing June 2012
Mobile Breakfast Briefing June 2012Mobile Breakfast Briefing June 2012
Mobile Breakfast Briefing June 2012User Vision
 
How to create a mobile version of your website
How to create a mobile version of your websiteHow to create a mobile version of your website
How to create a mobile version of your websiteMahmoud Farrag
 
The Laws of User Experience: Making it or breaking it with the UX Factor
The Laws of User Experience: Making it or breaking it with the UX FactorThe Laws of User Experience: Making it or breaking it with the UX Factor
The Laws of User Experience: Making it or breaking it with the UX FactorEffectiveUI
 
Workshop 11: Trendy web designs & prototyping
Workshop 11: Trendy web designs & prototypingWorkshop 11: Trendy web designs & prototyping
Workshop 11: Trendy web designs & prototypingVisual Engineering
 

Tendances (19)

Mobile web vs. native apps: It's not about technology, it's about psychology
Mobile web vs. native apps: It's not about technology, it's about psychologyMobile web vs. native apps: It's not about technology, it's about psychology
Mobile web vs. native apps: It's not about technology, it's about psychology
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
 
Responsive Design & Beyond [Code & Creativity Workshop]
Responsive Design & Beyond [Code & Creativity Workshop]Responsive Design & Beyond [Code & Creativity Workshop]
Responsive Design & Beyond [Code & Creativity Workshop]
 
Native Device vs. Mobile Web Applications
Native Device vs. Mobile Web ApplicationsNative Device vs. Mobile Web Applications
Native Device vs. Mobile Web Applications
 
Information Architecture in Mobile
Information Architecture in MobileInformation Architecture in Mobile
Information Architecture in Mobile
 
Getting Down & Dirty with Responsive Web Design
Getting Down & Dirty with Responsive Web DesignGetting Down & Dirty with Responsive Web Design
Getting Down & Dirty with Responsive Web Design
 
Responsive Web Design: Advantages & Best Practice - Darrin Adams, Cantarus
Responsive Web Design: Advantages & Best Practice - Darrin Adams, CantarusResponsive Web Design: Advantages & Best Practice - Darrin Adams, Cantarus
Responsive Web Design: Advantages & Best Practice - Darrin Adams, Cantarus
 
Responsive Web Design - Advantages and Best Practice for Sports Direct
Responsive Web Design - Advantages and Best Practice for Sports DirectResponsive Web Design - Advantages and Best Practice for Sports Direct
Responsive Web Design - Advantages and Best Practice for Sports Direct
 
Is the Browser a Transitional Technology?
Is the Browser a Transitional Technology?Is the Browser a Transitional Technology?
Is the Browser a Transitional Technology?
 
Mobile Web (R)Evolution - Sept 2011
Mobile Web (R)Evolution - Sept 2011Mobile Web (R)Evolution - Sept 2011
Mobile Web (R)Evolution - Sept 2011
 
Sitepen Getting There From Here
Sitepen   Getting There From HereSitepen   Getting There From Here
Sitepen Getting There From Here
 
Will apps replace the web? (or, why webhub.mobi?) - 6.8.2012
Will apps replace the web? (or, why webhub.mobi?) - 6.8.2012Will apps replace the web? (or, why webhub.mobi?) - 6.8.2012
Will apps replace the web? (or, why webhub.mobi?) - 6.8.2012
 
mobile usability
mobile usabilitymobile usability
mobile usability
 
Driving Mobile Traffic: SEO
 Driving Mobile Traffic: SEO Driving Mobile Traffic: SEO
Driving Mobile Traffic: SEO
 
Building mobile website with Joomla - Joomla!Days NL 2010 #jd10nl
Building mobile website with Joomla -  Joomla!Days NL 2010 #jd10nlBuilding mobile website with Joomla -  Joomla!Days NL 2010 #jd10nl
Building mobile website with Joomla - Joomla!Days NL 2010 #jd10nl
 
Mobile Breakfast Briefing June 2012
Mobile Breakfast Briefing June 2012Mobile Breakfast Briefing June 2012
Mobile Breakfast Briefing June 2012
 
How to create a mobile version of your website
How to create a mobile version of your websiteHow to create a mobile version of your website
How to create a mobile version of your website
 
The Laws of User Experience: Making it or breaking it with the UX Factor
The Laws of User Experience: Making it or breaking it with the UX FactorThe Laws of User Experience: Making it or breaking it with the UX Factor
The Laws of User Experience: Making it or breaking it with the UX Factor
 
Workshop 11: Trendy web designs & prototyping
Workshop 11: Trendy web designs & prototypingWorkshop 11: Trendy web designs & prototyping
Workshop 11: Trendy web designs & prototyping
 

Similaire à Web Apps vs Web Site

Road to mobile w/ Sinatra, jQuery Mobile, Spine.js and Mustache
Road to mobile w/ Sinatra, jQuery Mobile, Spine.js and MustacheRoad to mobile w/ Sinatra, jQuery Mobile, Spine.js and Mustache
Road to mobile w/ Sinatra, jQuery Mobile, Spine.js and MustacheBrian Sam-Bodden
 
Openwebdylanqconbeijing 090423091545-phpapp01
Openwebdylanqconbeijing 090423091545-phpapp01Openwebdylanqconbeijing 090423091545-phpapp01
Openwebdylanqconbeijing 090423091545-phpapp01youzitang
 
Mobile Web Overview https://www.edocr.com/v/k52p5vj4/
Mobile Web Overview https://www.edocr.com/v/k52p5vj4/Mobile Web Overview https://www.edocr.com/v/k52p5vj4/
Mobile Web Overview https://www.edocr.com/v/k52p5vj4/Jack Zheng
 
Native Vs HTML5 Apps
Native Vs HTML5 AppsNative Vs HTML5 Apps
Native Vs HTML5 AppsAppAcademy
 
Mobile Mantras: Experience Design Best Practices for Mobile Development
Mobile Mantras: Experience Design Best Practices for Mobile DevelopmentMobile Mantras: Experience Design Best Practices for Mobile Development
Mobile Mantras: Experience Design Best Practices for Mobile DevelopmentOne to One
 
Leverage web technology in a mobile world
Leverage web technology in a mobile worldLeverage web technology in a mobile world
Leverage web technology in a mobile worldDieter Blomme
 
Mobile Mantras: XD Best Practices for Mobile Development
Mobile Mantras: XD Best Practices for Mobile DevelopmentMobile Mantras: XD Best Practices for Mobile Development
Mobile Mantras: XD Best Practices for Mobile DevelopmentRob Fitzgibbon
 
Why should I care about Responsive Design?
Why should I care about Responsive Design?Why should I care about Responsive Design?
Why should I care about Responsive Design?Fabricio Teixeira
 
Mobile Mantras
Mobile MantrasMobile Mantras
Mobile Mantrashannerlib
 
The Mobile Landscape - Do you really need an app?
The Mobile Landscape - Do you really need an app?The Mobile Landscape - Do you really need an app?
The Mobile Landscape - Do you really need an app?Valtech UK
 
The mobile landscape london tfm&a 2013
The mobile landscape london tfm&a 2013The mobile landscape london tfm&a 2013
The mobile landscape london tfm&a 2013Mathias Strandberg
 
Den Multi Device Konsumenten zufrieden stellen …
Den Multi Device Konsumenten zufrieden stellen …Den Multi Device Konsumenten zufrieden stellen …
Den Multi Device Konsumenten zufrieden stellen …Connected-Blog
 
BLUG 2013 - Mobile Application Delivery - Choices, choices, choices
BLUG 2013 - Mobile Application Delivery - Choices, choices, choicesBLUG 2013 - Mobile Application Delivery - Choices, choices, choices
BLUG 2013 - Mobile Application Delivery - Choices, choices, choicesRené Winkelmeyer
 
Native vs Hybrid - Options to develop your mobile application
Native vs Hybrid - Options to develop your mobile applicationNative vs Hybrid - Options to develop your mobile application
Native vs Hybrid - Options to develop your mobile applicationLoic Ortola
 
The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife
The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - RecifeThe challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife
The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - RecifeCaridy Patino
 
Laurent hasson blackberry
Laurent hasson blackberryLaurent hasson blackberry
Laurent hasson blackberryWeb Summit
 

Similaire à Web Apps vs Web Site (20)

Uxperts mobi 2013 soa & challenges
Uxperts mobi 2013   soa & challengesUxperts mobi 2013   soa & challenges
Uxperts mobi 2013 soa & challenges
 
Mobile ux sot a and challenges
Mobile ux sot a and challengesMobile ux sot a and challenges
Mobile ux sot a and challenges
 
Mobile UX Challenges
Mobile UX ChallengesMobile UX Challenges
Mobile UX Challenges
 
Road to mobile w/ Sinatra, jQuery Mobile, Spine.js and Mustache
Road to mobile w/ Sinatra, jQuery Mobile, Spine.js and MustacheRoad to mobile w/ Sinatra, jQuery Mobile, Spine.js and Mustache
Road to mobile w/ Sinatra, jQuery Mobile, Spine.js and Mustache
 
Openwebdylanqconbeijing 090423091545-phpapp01
Openwebdylanqconbeijing 090423091545-phpapp01Openwebdylanqconbeijing 090423091545-phpapp01
Openwebdylanqconbeijing 090423091545-phpapp01
 
Mobile Web Overview https://www.edocr.com/v/k52p5vj4/
Mobile Web Overview https://www.edocr.com/v/k52p5vj4/Mobile Web Overview https://www.edocr.com/v/k52p5vj4/
Mobile Web Overview https://www.edocr.com/v/k52p5vj4/
 
Native Vs HTML5 Apps
Native Vs HTML5 AppsNative Vs HTML5 Apps
Native Vs HTML5 Apps
 
Mobile Mantras: Experience Design Best Practices for Mobile Development
Mobile Mantras: Experience Design Best Practices for Mobile DevelopmentMobile Mantras: Experience Design Best Practices for Mobile Development
Mobile Mantras: Experience Design Best Practices for Mobile Development
 
Leverage web technology in a mobile world
Leverage web technology in a mobile worldLeverage web technology in a mobile world
Leverage web technology in a mobile world
 
Mobile Mantras: XD Best Practices for Mobile Development
Mobile Mantras: XD Best Practices for Mobile DevelopmentMobile Mantras: XD Best Practices for Mobile Development
Mobile Mantras: XD Best Practices for Mobile Development
 
Why should I care about Responsive Design?
Why should I care about Responsive Design?Why should I care about Responsive Design?
Why should I care about Responsive Design?
 
EPA Victoria - Case study in responsive design
EPA Victoria - Case study in responsive designEPA Victoria - Case study in responsive design
EPA Victoria - Case study in responsive design
 
Mobile Mantras
Mobile MantrasMobile Mantras
Mobile Mantras
 
The Mobile Landscape - Do you really need an app?
The Mobile Landscape - Do you really need an app?The Mobile Landscape - Do you really need an app?
The Mobile Landscape - Do you really need an app?
 
The mobile landscape london tfm&a 2013
The mobile landscape london tfm&a 2013The mobile landscape london tfm&a 2013
The mobile landscape london tfm&a 2013
 
Den Multi Device Konsumenten zufrieden stellen …
Den Multi Device Konsumenten zufrieden stellen …Den Multi Device Konsumenten zufrieden stellen …
Den Multi Device Konsumenten zufrieden stellen …
 
BLUG 2013 - Mobile Application Delivery - Choices, choices, choices
BLUG 2013 - Mobile Application Delivery - Choices, choices, choicesBLUG 2013 - Mobile Application Delivery - Choices, choices, choices
BLUG 2013 - Mobile Application Delivery - Choices, choices, choices
 
Native vs Hybrid - Options to develop your mobile application
Native vs Hybrid - Options to develop your mobile applicationNative vs Hybrid - Options to develop your mobile application
Native vs Hybrid - Options to develop your mobile application
 
The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife
The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - RecifeThe challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife
The challenges of building mobile HTML5 applications - FEEC Brazil 2012 - Recife
 
Laurent hasson blackberry
Laurent hasson blackberryLaurent hasson blackberry
Laurent hasson blackberry
 

Plus de Matt Evans

Howtobydavetrott
HowtobydavetrottHowtobydavetrott
HowtobydavetrottMatt Evans
 
How to-fail-golden-drum2
How to-fail-golden-drum2How to-fail-golden-drum2
How to-fail-golden-drum2Matt Evans
 
Td 33 15_jul20_150_0
Td 33 15_jul20_150_0Td 33 15_jul20_150_0
Td 33 15_jul20_150_0Matt Evans
 
Se omoz the-beginners-guide-to-seo-2012
Se omoz the-beginners-guide-to-seo-2012Se omoz the-beginners-guide-to-seo-2012
Se omoz the-beginners-guide-to-seo-2012Matt Evans
 
Hyper island future_book_mobile
Hyper island future_book_mobileHyper island future_book_mobile
Hyper island future_book_mobileMatt Evans
 
There's more than web
There's more than webThere's more than web
There's more than webMatt Evans
 
Meteor presentationanpostindustrybreakfast
Meteor presentationanpostindustrybreakfastMeteor presentationanpostindustrybreakfast
Meteor presentationanpostindustrybreakfastMatt Evans
 

Plus de Matt Evans (7)

Howtobydavetrott
HowtobydavetrottHowtobydavetrott
Howtobydavetrott
 
How to-fail-golden-drum2
How to-fail-golden-drum2How to-fail-golden-drum2
How to-fail-golden-drum2
 
Td 33 15_jul20_150_0
Td 33 15_jul20_150_0Td 33 15_jul20_150_0
Td 33 15_jul20_150_0
 
Se omoz the-beginners-guide-to-seo-2012
Se omoz the-beginners-guide-to-seo-2012Se omoz the-beginners-guide-to-seo-2012
Se omoz the-beginners-guide-to-seo-2012
 
Hyper island future_book_mobile
Hyper island future_book_mobileHyper island future_book_mobile
Hyper island future_book_mobile
 
There's more than web
There's more than webThere's more than web
There's more than web
 
Meteor presentationanpostindustrybreakfast
Meteor presentationanpostindustrybreakfastMeteor presentationanpostindustrybreakfast
Meteor presentationanpostindustrybreakfast
 

Dernier

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 

Dernier (20)

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

Web Apps vs Web Site

  • 1. Web App Vs Web Site Some tricks of the trade Laurent Hasson @ldhasson, lhasson@rim.com Technical Director, BlackBerry Web Platform 2012-05-09 Web Apps Vs. Web Sites 1
  • 2. INTRODUCTION 2012-05-09 Web Apps Vs. Web Sites 2
  • 3. Web App Or Web Site? • Lots of controversies and differing opinions from very smart people on the Web – Should a mobile Web app be more Weby, or more Appy? • My take: users today are conditioned to the App Life Cycle – Download something – Install something – Have an icon on the home screen – The App takes the entire screen real estate – The App is integrated with the device • But users really don’t care how the app was built!!! – So use Web technologies for the job!! 2012-05-09 Web Apps Vs. Web Sites 3
  • 4. Two Dimensions to App Experience Life Cycle There are many options to make the journey Contents 2012-05-09 Web Apps Vs. Web Sites 4
  • 5. Two Dimensions to App Experience Life Cycle Contents 2012-05-09 Web Apps Vs. Web Sites 5
  • 6. Say no to NIBS - The “Native Is Better” crowd are missing the point of the Web - It’s the scale of the market stupid! - It’s powerful, cross-platform, and an abundant skill set. NIBS - This is not to say that Web is better than Native - That would be silly - But the Web is absolutely competitive - Most types of apps can now be built very nicely using Web technologies - The gap is narrow today, keeps on getting narrower, and fast. - Make no mistake * Native Is Better Syndrome - Native is the competition to Web 2012-05-09 Web Apps Vs. Web Sites 6
  • 7. Web App Design Goals • Single-page app metaphor – DOM manipulation for panels – And if not, mask page loading transitions • Lack of browser chrome – Links, Bookmarks and Back • Browser Events – Targeting multiple platforms means managing touches and clicks equally • Viewport Management – Horizontal bounciness is bad – Zooming can be dangerous 2012-05-09 Web Apps Vs. Web Sites 7
  • 8. VIEWPORT 2012-05-09 Web Apps Vs. Web Sites 8
  • 9. When a pixel is no longer a pixel • The desktop viewport is WYSIWYG – Window dimensions are well known • On mobile, it’s a whole other story – What you see is a viewport on a larger “thing” • Panning is a fact of life for most users • Zooming is a critical part of the browser UX • And pixels are no longer display-relevant – High DPI and other display technologies have changed the meaning of what a pixel is – Better res without breaking the Web 2012-05-09 Web Apps Vs. Web Sites 9
  • 10. CSS Pixels • These are the pixels we deal with everyday – CSS definitions – Inline dimensions in HTML – Media queries • On desktop, a CSS px == 1 device px • On mobile, don’t even try – The device vendor decides what the mapping is – You typically can’t tell programmatically what the ratio is – So deal with those abstract pixels • On BlackBerry, default is 160DPI 2012-05-09 Web Apps Vs. Web Sites 10
  • 11. HUH? 2012-05-09 Web Apps Vs. Web Sites 11
  • 12. How many Pixel? • screen.width/height – Device pixels – Entire screen, pretty useless as it’s really a desktop concept • document.documentElement.clientWidth/clientHeight – CSS pixels: 768px (usable space, minus browser chrome, so height is different) – Useful for media queries • window.innerWidth/innerHeight – CSS Pixels of viewport: Depending on zoom level – DPI-scaled: 350px width (native res scaled to 160dpi for zoom-level of 1) • window.pageXOffset/pageYOffset – CSS Pixels of scrolling 2012-05-09 12 Web Apps Vs. Web Sites
  • 13. Viewport and Media Queries <meta name="viewport" content="height=device-height, width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> – Makes sure your page doesn’t flow beyond screen dimensions (including margins and borders) – Works as long as your content doesn’t force overflow – Deal in % • @media all and (max-width: 480px) { … } – There are other flexible syntaxes for CSS media queries 2012-05-09 Web Apps Vs. Web Sites 13
  • 14. Orientation: Landscape or Portrait • Make sure you test in both modes • Or lock the orientation – There are configuration flags available through packagers such as Apache Cordova • Upcoming ScreenOrientation API – screen.orientation=“portrait”|”landscape”|…, screen.lockOrientation(“…”), screen.unlockOrientation(), screen.onOrientationChange – Languishing… 2012-05-09 Web Apps Vs. Web Sites 14
  • 15. EVENTS: TOUCHES, CLICKS… 2012-05-09 Web Apps Vs. Web Sites 15
  • 16. World Wide Web == Wild Wild West • Some platforms do touch well • Others simulate clicks – With delays and quirks • Behaviors expected when preventDefault() are not consistent • Plus, you may want to create Web content that also works in a browser – That’s still an important goal if it makes sense to you 2012-05-09 Web Apps Vs. Web Sites 16
  • 17. Your mileage may vary TouchStart If nothing else within 300ms MouseDown TouchMove MouseMove MouseUp TouchEnd MouseClick • Delay is not the same everywhere • The interplay between touch and mouse events vary • The effect of onPreventDetault() vary 2012-05-09 Web Apps Vs. Web Sites 17
  • 18. The Infamous Delay • When the browser gets a touch, it needs to wait to see if there is a move or not – Some of the browser’s own UX for pan/zoom need that – Typically 300ms • In your app, you should take control of that – You typically don’t want zooming gestures – You know what you expect from your users – You don’t want that 300ms delay 2012-05-09 Web Apps Vs. Web Sites 18
  • 19. touch-event-mode: BlackBerry Only  <meta name="touch-event- <meta name="touch-event- mode” content="native"> mode" content=”pure-with- mouse-conversion"> • WebPage gets TouchEvents only from touch screen. • WebPage gets both Touch events and Mouse events. User touches screen User touches screen Touch Touch onTouch Y XXX? DONE N DONE Mouse Browser UX disabled: DoubleTap zoom, pinch zoom, text selection and context menus 2012-05-09 Web Apps Vs. Web Sites 19
  • 20. Control Your Destiny TouchStart MouseDown TouchMove MouseMove MouseUp TouchEnd MouseClick 2012-05-09 Web Apps Vs. Web Sites 20
  • 21. Yeah, i know, it’s a bit controversial 2012-05-09 Web Apps Vs. Web Sites 21
  • 22. Custom Event Handling if (Touch) { document.ontouchend = function(event) { Blocks Browser UX behaviors event.preventDefault(); var e = event.target; You may have to walk up the parent while (e && !e.click) nodes to find an actual click() handler. e = e.parentNode; Convert touch coordinates to click if (!e || !e.click) coordinates return; event.clientX = event.changedTouches[0].pageX; event.clientY = event.changedTouches[0].pageY; e.click(event); } Invoke the onClick handler } You may want to do things differently to suit your app requirements, but the core idea is here 2012-05-09 Web Apps Vs. Web Sites 22
  • 23. Other virtual events systems • Maps deviceOrientation events to key events – Simulates up/down/left/right arrows, or WASD or whatever – Most virtual keyboards don’t have arrow keys – Most virtual keyboards wouldn’t make sense in games anyways – Redirects to onKeyUp • Famous frameworks, such as jQueryMobile, do it too, to gain control of, and unify, events. 2012-05-09 Web Apps Vs. Web Sites 23
  • 24. user-select • There is one more browser UX you may want to disable as well – User selection can be very annoying when in an app body { user-select: none; } • Or do that on selected sub-DOMs of your app • In some cases, it makes sense, and you want to reuse the browser mechanisms for that 2012-05-09 Web Apps Vs. Web Sites 24
  • 25. NO BROWSER CHROME 2012-05-09 Web Apps Vs. Web Sites 25
  • 26. Arguably, the Web is about Navigation • You don’t realize how much the Browser’s skin does with your site until you don’t have it anymore • So many sites can still paint you into a corner where you can’t escape without the back button – Even some big sites do it (I won’t name names!) • How about navigation – Many APIs exist now, and are well supported to help you. 2012-05-09 Web Apps Vs. Web Sites 26
  • 27. Bookmarks == saved application states • Why wouldn’t you let your users create in-app bookmarks for content they specially like? • Doing an App now doesn’t mean you have to forget about REST principles and what has made the Web so cool! • You need – The History API – Local storage – Some UI to let your users manage their “bookmarks” 2012-05-09 Web Apps Vs. Web Sites 27
  • 28. And for debugging? location.reload(true) 2012-05-09 Web Apps Vs. Web Sites 28
  • 29. CONCLUSION 2012-05-09 Web Apps Vs. Web Sites 29
  • 30. Web Apps <> Web Sites • If you subscribe to the idea that Web apps must be Appy, then do things a bit differently – Viewport management must be explicit – Manage your own events – Navigation is different due to lack of chrome • But don’t drop what makes the web so cool – Navigation and Bookmarks are powerful features • And debugging is hard, unless you do it on a BlackBerry – Best mobile browser AND built-in full remote WebInspector 2012-05-09 Web Apps Vs. Web Sites 30
  • 31. The End – Thank You 2012-05-09 Web Apps Vs. Web Sites 31
  • 32. References Slide 2: The Matrix (1999) Slide 5: BlackBerry Loves Apache Cordova Slide 8: Poltergeist (1982) Slide 11: Videodrome (1983) Slide 15: Nightmare On Elm Street (1984) Slide 21: Hellraiser (1987) Slide 25: Tetsuo (1989) Slide 29: Anguish (1987) Slide 31: Masters Of Horror: Family (2006) 2012-05-09 Web Apps Vs. Web Sites 32