SlideShare a Scribd company logo
HTML for the Mobile Web
All Things Open
Firefox OS
2014-10-22
Frédéric Harper
Sr. Technical Evangelist @ Mozilla
@fharper | outofcomfortzone.net
CreativeCommons:https://flic.kr/p/5HzQsy
Creative Commons: http://j.mp/1hCZYIe
Creative Commons: http://j.mp/1ljZuJC
HTML for the Mobile Web, Firefox OS
HTML for the Mobile Web, Firefox OS
38 billion devices
connected in 2020
ABI Research - 2013-05-09 - http://j.mp/38billion
Creative Commons: http://j.mp/1gP4X4K
HTML for the Mobile Web, Firefox OS
What you deserve
HTML for the Mobile Web, Firefox OS
Built with the Web
Using HTML5, CSS3 and JavaScript
with a number of APIs
to build apps.
It’s open source
Some facts
•  Available in more than 24 countries
•  Primarly aimed at emerging & low
end markets
Some of the devices
HTML for the Mobile Web, Firefox OS
HTML for the Mobile Web, Firefox OS
HTML for the Mobile Web, Firefox OS
HTML for the Mobile Web, Firefox OS
HTML for the Mobile Web, Firefox OS
A Firefox OS app?
§  Creating a hosted or packaged app
§  Using
§  Vanilla HTML5
§  Librairies…
§  Regular API
§  Privileged API
§  Certified API
HTML5 + manifest (JSON) = Firefox OS app
{
"version": “42",
"name": ”My amazing app",
"launch_path": "/index.html",
"description": ”My super amazing app do super amazing things",
"icons": {
"16": "/images/logo16.png”,},
"developer": {
"name": ”Frédéric Harper",
"url": "http://outofcomfortzone.net",
},
"default_locale": "en",
"permissions": {
"geolocation": {
"description": ”Get the long/lat of the user"
}
}
}
DEMO
Firefox OS + App Manager
+ Emberjs todomvc
Web APIs
Web APIs – Regular
•  Alarm API
•  Ambient light sensor
•  Archive API
•  Battery Status API
•  Geolocation API
•  IndexedDB
•  Network Information API
•  Notifications API
•  Open WebApps
•  Proximity sensor
•  Push API
•  Screen Orientation
•  Vibration API
•  Web Activities
•  WebFM API
•  WebPayment
packaged
hosted
Ambient Light Sensor
Ambient Light Sensor
window.addEventListener("devicelight", function (event) {
// The level of the ambient light in lux
// The lux values for "dim" typically begin below 50,
// and the values for "bright" begin above 10000
console.log(event.value);
});
DEMO Boilerplate – Ambient Light Sensor
Battery Status
Battery Status
var battery = navigator.battery;
if (battery) {
var batteryLevel = Math.round(battery.level * 100) + "%",
 
charging = (battery.charging)? “yes" : "no",
chargingTime = parseInt(battery.chargingTime / 60, 10,
dischargingTime = parseInt(battery.dischargingTime / 60, 10);
 
battery.addEventListener("levelchange", setStatus, false);
battery.addEventListener("chargingchange", setStatus, false);
battery.addEventListener("chargingtimechange", setStatus, false);
}
Web APIs – Privileged
•  Browser API
•  Contacts API
•  Device Storage API
•  systemXHR
•  TCP Socket API
packaged
Browser
Browser
<div>
<span id='location-bar'></span>
<button onclick='go_button_clicked()'>Go</button>
</div>
<div id='load-status'></div>
<div id='security-status'></div>
<img id='favicon'>
<div id='title'></div>
<iframe mozbrowser src=‘yoursite.com' id='browser'></iframe>
Browser
addEventListener('mozbrowserloadstart', function(e) {
//Do stuff
});
/*
Possible values:
"mozbrowserloadstart“ "mozbrowserloadend"
"mozbrowserlocationchange“ "mozbrowsertitlechange"
"mozbrowsericonchange“ "mozbrowsersecuritychange"
"mozbrowsercontextmenu“ "mozbrowsererror"
"mozbrowserkeyevent“ "mozbrowsershowmodalprompt"
"mozbrowseropenwindow“ "mozbrowserclose"
*/
Web APIs – Certified
•  Camera API
•  Idle API
•  Mobile Connection API
•  Network Stats API
•  Permissions API
•  Power Management API
•  Settings API
•  Time/Clock API
•  Voicemail
•  WebBluetooth
•  WebSMS
•  WebTelephony
•  WiFi Information API
OS/OEM
Web Activities
Web Activities
•  browse
•  configure
•  costcontrol
•  dial
•  Open
•  new
•  mail
•  websms/sms
•  webcontacts/contact
•  pick
•  record
•  save-bookmark
•  share
•  view
•  update
packaged
hosted
Pick
var activity = new MozActivity({
name: "pick",
//Provide the data required
//by the filter of the activity
data: {
type: "image/jpeg"
}
});
Pick
activity.onsuccess = function () {
var img = document.createElement("img");
if (this.result.blob.type.indexOf("image") != -1) {
img.src = window.URL.createObjectURL(this.result.blob);
}
};
activity.onerror = function () {
//error
};
Dial
var call = new MozActivity({
name: "dial",
data: {
number: "+46777888999"
}
});
Web Activity Received Handler
"activities": {
"pick": {
"filters": {
"type": ["image/jpeg", "image/png"]
},
"disposition": "inline",
"returnValue": true,
"href": "/index.html#pick"
}
}
Don’t forget to handle it!
navigator.mozSetMessageHandler('activity', function(activityRequest) {
var option = activityRequest.source;
if (activityRequest.source.name === "pick") {
// Do something to handle the activity
if (picture) {
activityRequest.postResult(picture);
}
else {
activityRequest.postError("Unable to provide a picture");
}
}
});
Creative Commons: http://j.mp/1iZHGAW
Creative Commons: https://flic.kr/p/4mJnLg
How to start
Creative Commons: http://j.mp/1iquK8Q
Creative Commons: http://j.mp/Ilm7wx
Phonegap & Cordova
& <3
Plugins
implementation
http://mozilla-cordova.github.io/
Simplicity…
Firefox Web Developer Tools
HTML for the Mobile Web, Firefox OS
HTML for the Mobile Web, Firefox OS
Creative Commons: http://j.mp/1gIdcPF
To infinity, and
beyond…
More Web APIs & features
•  Calendar API
•  FileHandle API Sync API
•  Keyboard/IME API WebRTC
•  HTTP-cache API
•  Peer to Peer API
•  Spellcheck API LogAPI
•  Resource lock API
•  UDP Datagram Socket API
•  WebNFC
•  WebUSB
Next time you’ll build a mobile app
Think about HTML5 & Firefox OS
Resources
Firefox OS Simulator
http://j.mp/fxosSimulator
Firefox OS App Manager
http://j.mp/fxosAppManager
Mozilla Developer Network
https://developer.mozilla.org
StackOverflow forum
http://j.mp/fxosStackOverflow
Firefox OS Boilerplate
http://j.mp/fxosBoilerplate
Frédéric Harper
fharper@mozilla.com
@fharper
http://hacks.mozilla.org
http://outofcomfortzone.net

More Related Content

PDF
Firefox OS, HTML5 pour le mobile - Code(love) Hackathon - 2014-05-28
PPTX
Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 201...
PDF
Integrating WordPress With Web APIs
PPTX
W3 conf hill-html5-security-realities
PPTX
In-browser storage and me
PPTX
Emerging threats jonkman_sans_cti_summit_2015
PPTX
Building Secure User Interfaces With JWTs
PDF
2016 pycontw web api authentication
Firefox OS, HTML5 pour le mobile - Code(love) Hackathon - 2014-05-28
Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 201...
Integrating WordPress With Web APIs
W3 conf hill-html5-security-realities
In-browser storage and me
Emerging threats jonkman_sans_cti_summit_2015
Building Secure User Interfaces With JWTs
2016 pycontw web api authentication

What's hot (20)

PDF
Authentication: Cookies vs JWTs and why you’re doing it wrong
PDF
CredHub and Secure Credential Management
PDF
Repaso rápido a los nuevos estándares web
PDF
Crossing the Boundaries of Web Applications with OpenSocial
PDF
Super simple application security with Apache Shiro
PPTX
JWT Authentication with AngularJS
PDF
Stateless authentication for microservices - GR8Conf 2015
PDF
JSON API: Não reinvente a roda
PDF
アプリ開発で知っておきたい認証技術 - OAuth 1.0 + OAuth 2.0 + OpenID Connect -
PPTX
Browser Internals-Same Origin Policy
PPTX
Accelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
PDF
Json web token api authorization
PPTX
ApacheCon 2014: Infinite Session Clustering with Apache Shiro & Cassandra
PPTX
Intro to Apache Shiro
PPTX
Build A Killer Client For Your REST+JSON API
PPTX
Case Study of Django: Web Frameworks that are Secure by Default
PDF
Kotlin server side frameworks
PPTX
Token Authentication for Java Applications
PPTX
Build a Node.js Client for Your REST+JSON API
PDF
Modern Security with OAuth 2.0 and JWT and Spring by Dmitry Buzdin
Authentication: Cookies vs JWTs and why you’re doing it wrong
CredHub and Secure Credential Management
Repaso rápido a los nuevos estándares web
Crossing the Boundaries of Web Applications with OpenSocial
Super simple application security with Apache Shiro
JWT Authentication with AngularJS
Stateless authentication for microservices - GR8Conf 2015
JSON API: Não reinvente a roda
アプリ開発で知っておきたい認証技術 - OAuth 1.0 + OAuth 2.0 + OpenID Connect -
Browser Internals-Same Origin Policy
Accelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
Json web token api authorization
ApacheCon 2014: Infinite Session Clustering with Apache Shiro & Cassandra
Intro to Apache Shiro
Build A Killer Client For Your REST+JSON API
Case Study of Django: Web Frameworks that are Secure by Default
Kotlin server side frameworks
Token Authentication for Java Applications
Build a Node.js Client for Your REST+JSON API
Modern Security with OAuth 2.0 and JWT and Spring by Dmitry Buzdin
Ad

Viewers also liked (20)

PDF
The Anti-Henry Ford: How 200 hour discoveries revolutionized the way we do bu...
PDF
Open Data + Open Government = Open Goodness
PDF
What Academia Can Learn from Open Source
PPTX
Considerations for Operating an OpenStack Cloud
PDF
Open Source & The Internet of Things
PPTX
Sustainable Open Data Markets
PDF
Battle of the Stacks
PDF
Lessons Learned with Distributed Systems at Bitly
PDF
Developing Apps for Google Glass Using Javascript & Ruby
PDF
Choosing a Javascript Framework
PPT
Open Sourcing the Public Library
PDF
Trademarks and Your Free and Open Source Software Project
PDF
Women in Open Source
PDF
Building the iRODS Consortium
PDF
The PHP Renaissance
PDF
Marketing is not all fluff; engineering is not all math
PDF
The Gurubox Project: Open Source Troubleshooting Tools
PDF
Case Study: We're Watching You: How and Why Researchers Study Open Source And...
PDF
Open Source in Healthcare
PDF
Open Source Systems Administration
The Anti-Henry Ford: How 200 hour discoveries revolutionized the way we do bu...
Open Data + Open Government = Open Goodness
What Academia Can Learn from Open Source
Considerations for Operating an OpenStack Cloud
Open Source & The Internet of Things
Sustainable Open Data Markets
Battle of the Stacks
Lessons Learned with Distributed Systems at Bitly
Developing Apps for Google Glass Using Javascript & Ruby
Choosing a Javascript Framework
Open Sourcing the Public Library
Trademarks and Your Free and Open Source Software Project
Women in Open Source
Building the iRODS Consortium
The PHP Renaissance
Marketing is not all fluff; engineering is not all math
The Gurubox Project: Open Source Troubleshooting Tools
Case Study: We're Watching You: How and Why Researchers Study Open Source And...
Open Source in Healthcare
Open Source Systems Administration
Ad

Similar to HTML for the Mobile Web, Firefox OS (20)

PPTX
Firefox OS - The platform you deserve - Athens App Days - 2013-11-27
PPTX
Firefox OS - The platform you deserve - Firefox OS Budapest workshop - 2013-1...
PDF
Web APIs & Apps - Mozilla
PDF
WebAPIs & Apps - Mozilla London
PDF
Mobile Web Development with HTML5
PPTX
HTML5 WebWorks
PDF
Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example
KEY
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
KEY
An Introduction to webOS
PDF
Integrating WordPress With Web APIs
PDF
Web Standards Support in WebKit
PDF
RoR Workshop - Web applications hacking - Ruby on Rails example
PDF
Advanced programing in phonegap
PDF
Introduction phonegap
PPTX
Edge of the Web
PPS
Hacking Client Side Insecurities
PPTX
SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...
PDF
Firefox OS - HTML5 for a truly world-wide-web
PPTX
HTML5 on Mobile
PDF
Mobile Vue.js – From PWA to Native
Firefox OS - The platform you deserve - Athens App Days - 2013-11-27
Firefox OS - The platform you deserve - Firefox OS Budapest workshop - 2013-1...
Web APIs & Apps - Mozilla
WebAPIs & Apps - Mozilla London
Mobile Web Development with HTML5
HTML5 WebWorks
Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
An Introduction to webOS
Integrating WordPress With Web APIs
Web Standards Support in WebKit
RoR Workshop - Web applications hacking - Ruby on Rails example
Advanced programing in phonegap
Introduction phonegap
Edge of the Web
Hacking Client Side Insecurities
SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...
Firefox OS - HTML5 for a truly world-wide-web
HTML5 on Mobile
Mobile Vue.js – From PWA to Native

More from All Things Open (20)

PDF
Agentic AI for Developers and Data Scientists Build an AI Agent in 10 Lines o...
PPTX
Big Data on a Small Budget: Scalable Data Visualization for the Rest of Us - ...
PDF
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
PDF
Let's Create a GitHub Copilot Extension! - Nick Taylor, Pomerium
PDF
Leveraging Pre-Trained Transformer Models for Protein Function Prediction - T...
PDF
Gen AI: AI Agents - Making LLMs work together in an organized way - Brent Las...
PDF
You Don't Need an AI Strategy, But You Do Need to Be Strategic About AI - Jes...
PPTX
DON’T PANIC: AI IS COMING – The Hitchhiker’s Guide to AI - Mark Hinkle, Perip...
PDF
Fine-Tuning Large Language Models with Declarative ML Orchestration - Shivay ...
PDF
Leveraging Knowledge Graphs for RAG: A Smarter Approach to Contextual AI Appl...
PPTX
Artificial Intelligence Needs Community Intelligence - Sriram Raghavan, IBM R...
PDF
Don't just talk to AI, do more with AI: how to improve productivity with AI a...
PPTX
Open-Source GenAI vs. Enterprise GenAI: Navigating the Future of AI Innovatio...
PDF
The Death of the Browser - Rachel-Lee Nabors, AgentQL
PDF
Making Operating System updates fast, easy, and safe
PDF
Reshaping the landscape of belonging to transform community
PDF
The Unseen, Underappreciated Security Work Your Maintainers May (or may not) ...
PDF
Integrating Diversity, Equity, and Inclusion into Product Design
PDF
The Open Source Ecosystem for eBPF in Kubernetes
PDF
Open Source Privacy-Preserving Metrics - Sarah Gran & Brandon Pitman
Agentic AI for Developers and Data Scientists Build an AI Agent in 10 Lines o...
Big Data on a Small Budget: Scalable Data Visualization for the Rest of Us - ...
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
Let's Create a GitHub Copilot Extension! - Nick Taylor, Pomerium
Leveraging Pre-Trained Transformer Models for Protein Function Prediction - T...
Gen AI: AI Agents - Making LLMs work together in an organized way - Brent Las...
You Don't Need an AI Strategy, But You Do Need to Be Strategic About AI - Jes...
DON’T PANIC: AI IS COMING – The Hitchhiker’s Guide to AI - Mark Hinkle, Perip...
Fine-Tuning Large Language Models with Declarative ML Orchestration - Shivay ...
Leveraging Knowledge Graphs for RAG: A Smarter Approach to Contextual AI Appl...
Artificial Intelligence Needs Community Intelligence - Sriram Raghavan, IBM R...
Don't just talk to AI, do more with AI: how to improve productivity with AI a...
Open-Source GenAI vs. Enterprise GenAI: Navigating the Future of AI Innovatio...
The Death of the Browser - Rachel-Lee Nabors, AgentQL
Making Operating System updates fast, easy, and safe
Reshaping the landscape of belonging to transform community
The Unseen, Underappreciated Security Work Your Maintainers May (or may not) ...
Integrating Diversity, Equity, and Inclusion into Product Design
The Open Source Ecosystem for eBPF in Kubernetes
Open Source Privacy-Preserving Metrics - Sarah Gran & Brandon Pitman

Recently uploaded (20)

PDF
Empathic Computing: Creating Shared Understanding
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Encapsulation theory and applications.pdf
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
1. Introduction to Computer Programming.pptx
PDF
Getting Started with Data Integration: FME Form 101
PPTX
Tartificialntelligence_presentation.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Empathic Computing: Creating Shared Understanding
“AI and Expert System Decision Support & Business Intelligence Systems”
Per capita expenditure prediction using model stacking based on satellite ima...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Encapsulation_ Review paper, used for researhc scholars
Encapsulation theory and applications.pdf
SOPHOS-XG Firewall Administrator PPT.pptx
MIND Revenue Release Quarter 2 2025 Press Release
NewMind AI Weekly Chronicles - August'25-Week II
Diabetes mellitus diagnosis method based random forest with bat algorithm
Mobile App Security Testing_ A Comprehensive Guide.pdf
Spectral efficient network and resource selection model in 5G networks
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
1. Introduction to Computer Programming.pptx
Getting Started with Data Integration: FME Form 101
Tartificialntelligence_presentation.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

HTML for the Mobile Web, Firefox OS