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
 
Tuenti Mobile Development
Tuenti Mobile DevelopmentTuenti Mobile Development
Tuenti Mobile DevelopmentTuenti
 
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
 
Information Architecture in Mobile
Information Architecture in MobileInformation Architecture in Mobile
Information Architecture in MobileLazar Petrakiev
 
Mobile Web (R)Evolution - Sept 2011
Mobile Web (R)Evolution - Sept 2011Mobile Web (R)Evolution - Sept 2011
Mobile Web (R)Evolution - Sept 2011arendsf
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web DesignJulia Vi
 
Native Device vs. Mobile Web Applications
Native Device vs. Mobile Web ApplicationsNative Device vs. Mobile Web Applications
Native Device vs. Mobile Web ApplicationsTim Wright
 
The mobile browser world
The mobile browser worldThe mobile browser world
The mobile browser worldPeter-Paul Koch
 
Best Practices For Delivering Quality Web Experiences In A Mobile, Multi-Brow...
Best Practices For Delivering Quality Web Experiences In A Mobile, Multi-Brow...Best Practices For Delivering Quality Web Experiences In A Mobile, Multi-Brow...
Best Practices For Delivering Quality Web Experiences In A Mobile, Multi-Brow...Compuware APM
 
Building Mobile Websites with Joomla
Building Mobile Websites with JoomlaBuilding Mobile Websites with Joomla
Building Mobile Websites with JoomlaTom Deryckere
 
Going mobile edu web presentation - 2011
Going mobile   edu web presentation - 2011Going mobile   edu web presentation - 2011
Going mobile edu web presentation - 2011Nathan Gerber
 
State of the Mobile Browsers
State of the Mobile BrowsersState of the Mobile Browsers
State of the Mobile BrowsersPeter-Paul Koch
 
The Mobile Web - Fronteers 2009
The Mobile Web - Fronteers 2009The Mobile Web - Fronteers 2009
The Mobile Web - Fronteers 2009Peter-Paul Koch
 
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
 
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
 
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
 

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
 
Tuenti Mobile Development
Tuenti Mobile DevelopmentTuenti Mobile Development
Tuenti Mobile Development
 
Responsive Design & Beyond [Code & Creativity Workshop]
Responsive Design & Beyond [Code & Creativity Workshop]Responsive Design & Beyond [Code & Creativity Workshop]
Responsive Design & Beyond [Code & Creativity Workshop]
 
Information Architecture in Mobile
Information Architecture in MobileInformation Architecture in Mobile
Information Architecture in Mobile
 
Mobile Web (R)Evolution - Sept 2011
Mobile Web (R)Evolution - Sept 2011Mobile Web (R)Evolution - Sept 2011
Mobile Web (R)Evolution - Sept 2011
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
 
Native Device vs. Mobile Web Applications
Native Device vs. Mobile Web ApplicationsNative Device vs. Mobile Web Applications
Native Device vs. Mobile Web Applications
 
The mobile browser world
The mobile browser worldThe mobile browser world
The mobile browser world
 
Best Practices For Delivering Quality Web Experiences In A Mobile, Multi-Brow...
Best Practices For Delivering Quality Web Experiences In A Mobile, Multi-Brow...Best Practices For Delivering Quality Web Experiences In A Mobile, Multi-Brow...
Best Practices For Delivering Quality Web Experiences In A Mobile, Multi-Brow...
 
Building Mobile Websites with Joomla
Building Mobile Websites with JoomlaBuilding Mobile Websites with Joomla
Building Mobile Websites with Joomla
 
Going mobile edu web presentation - 2011
Going mobile   edu web presentation - 2011Going mobile   edu web presentation - 2011
Going mobile edu web presentation - 2011
 
State of the Mobile Browsers
State of the Mobile BrowsersState of the Mobile Browsers
State of the Mobile Browsers
 
The Mobile Web - Fronteers 2009
The Mobile Web - Fronteers 2009The Mobile Web - Fronteers 2009
The Mobile Web - Fronteers 2009
 
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
 
mobile usability
mobile usabilitymobile usability
mobile usability
 
mobile presentation
mobile presentationmobile presentation
mobile presentation
 
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
 
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
 

En vedette

Howtobydavetrott
HowtobydavetrottHowtobydavetrott
HowtobydavetrottMatt Evans
 
There's more than web
There's more than webThere's more than web
There's more than webMatt Evans
 
How to-fail-golden-drum2
How to-fail-golden-drum2How to-fail-golden-drum2
How to-fail-golden-drum2Matt Evans
 
Hyper island future_book_mobile
Hyper island future_book_mobileHyper island future_book_mobile
Hyper island future_book_mobileMatt 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
 
Meteor presentationanpostindustrybreakfast
Meteor presentationanpostindustrybreakfastMeteor presentationanpostindustrybreakfast
Meteor presentationanpostindustrybreakfastMatt Evans
 

En vedette (7)

Howtobydavetrott
HowtobydavetrottHowtobydavetrott
Howtobydavetrott
 
There's more than web
There's more than webThere's more than web
There's more than web
 
How to-fail-golden-drum2
How to-fail-golden-drum2How to-fail-golden-drum2
How to-fail-golden-drum2
 
Hyper island future_book_mobile
Hyper island future_book_mobileHyper island future_book_mobile
Hyper island future_book_mobile
 
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
 
Meteor presentationanpostindustrybreakfast
Meteor presentationanpostindustrybreakfastMeteor presentationanpostindustrybreakfast
Meteor presentationanpostindustrybreakfast
 

Similaire à Web App 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
 
Sitepen Getting There From Here
Sitepen   Getting There From HereSitepen   Getting There From Here
Sitepen Getting There From HereGeorge Ang
 
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
 

Similaire à Web App 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
 
Sitepen Getting There From Here
Sitepen   Getting There From HereSitepen   Getting There From Here
Sitepen Getting There From Here
 
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
 

Dernier

Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
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
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
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
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Dernier (20)

Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.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
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
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
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

Web App 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