Developing for the Mobile Web

Mobile Web Handbook

Peter-Paul Koch

Mobile Browsers

Wikipedia

History of Mobile Browsers

WAP

Desktop Browsers

  • Safari
  • Android Webkit
  • Chrome
  • Opera
  • UC

iOS

iOS 8

Mobile Safari 8

iOS 7

Mobile Safari 7

Android

Zoom Text Reflow

Samsung

HTC

WAT?

Google Services

  • Android Webkit
  • Google Chrome

Chromium

  • Samsung (S4+) - Chromium (Version 28)
  • Amazon - Silk (Chromium) - (no Google Services)
  • Nexus - Goolge Chrome (Google's Chromium)
  • Motorola - Google Chrome
  • HTC (4.2+) - Android Webkit

Blink

WAT?

We Officially Support

Latest Mobile Safari -1

Latest Mobile Chrome -1

Development Tools

iOS Simulator

Android Emulator

Safari Dev Tools

Edge Inspect CC

Charles

Confluence: HowTo - Test Mobile Devices on Localhost (with login)

Remember Touch Events

  • touchstart
  • touchend
  • touchmove
  • mousedown
  • mouseup or click
  • mousemove
var canvas = document.querySelector('#canvas'),
    img = document.querySelector('#img');

    
function dragInit(){
  // save initial pointer/touch positions relative to photo
  document.addEventListener('mousemove', drag);
  document.addEventListener('touchmove', drag);
}

function drag(){
  // calculate pointer/touch point relative to intial pointer/touch points
}

function unBindDrag() {
  document.removeEventListener('mousemove', drag);
  document.removeEventListener('touchmove', drag);
}

img.addEventListener('load', function(){
  
  // Bind Events
  canvas.addEventListener('mousedown', dragInit);
  canvas.addEventListener('touchstart', dragInit);
  
  document.addEventListener('mouseup', unBindDrag);
  document.addEventListener('touchend', unBindDrag);
  
});

Avatar Example

Demo

Go and Do

Developing for the Mobile Web

By Tyler Graf

Developing for the Mobile Web

  • 1,066