SlideShare a Scribd company logo
Firefox OS
Firefox OS Introduction at Bontouch
@robertnyman
Mozilla is a
global non-
profit dedicated
to putting you
in control of
your online
experience and
shaping the
future of the
Web for the
public good
Firefox OS Introduction at Bontouch
Firefox OS Introduction at Bontouch
Using HTML5, CSS and
JavaScript together with a
number of APIs to build
apps and customize the UI.
Firefox OS
A walk in the park
Open Web Apps
Build excellent interfaces!
Packaged vs. Hosted Apps
WebAPIs
Firefox OS Introduction at Bontouch
Security Levels
Web Content
Regular web content
Installed Web App
A regular web app
Privileged Web App
More access, more responsibility
Certified Web App
Device-critical applications
https://wiki.mozilla.org/
WebAPI#Planned_for_initial_release_of_B2G_.
28aka_Basecamp.29
"permissions": {
"contacts": {
"description": "Required for autocompletion in the share screen",
"access": "readcreate"
},
"alarms": {
"description": "Required to schedule notifications"
}
}
PERMISSIONS
Vibration API (W3C)
Screen Orientation
Geolocation API
Mouse Lock API (W3C)
Open WebApps
Network Information API (W3C)
Battery Status API (W3C)
Alarm API
Web Activities
Push Notifications API
WebFM API
WebPayment
IndexedDB (W3C)
Ambient light sensor
Proximity sensor
Notification
REGULAR APIS
BATTERY STATUS
API
var battery = navigator.battery;
if (battery) {
var batteryLevel = Math.round(battery.level * 100) + "%",
charging = (battery.charging)? "" : "not ",
chargingTime = parseInt(battery.chargingTime / 60, 10),
dischargingTime = parseInt(battery.dischargingTime / 60, 10);
// Set events
battery.addEventListener("levelchange", setStatus, false);
battery.addEventListener("chargingchange", setStatus, false);
battery.addEventListener("chargingtimechange", setStatus, false);
battery.addEventListener("dischargingtimechange", setStatus, false);
}
SCREEN
ORIENTATION API
// Portrait mode:
screen.mozLockOrientation("portrait");
/*
Possible values:
"landscape"
"portrait"
"landscape-primary"
"landscape-secondary"
"portrait-primary"
"portrait-secondary"
*/
VIBRATION API
// Vibrate for one second
navigator.vibrate(1000);
// Vibration pattern [vibrationTime, pause,…]
navigator.vibrate([200, 100, 200, 100]);
// Vibrate for 5 seconds
navigator.vibrate(5000);
// Turn off vibration
navigator.vibrate(0);
DEVICEPROXIMITY
window.addEventListener("deviceproximity", function (event) {
// Current device proximity, in centimeters
console.log(event.value);
// The maximum sensing distance the sensor is
// able to report, in centimeters
console.log(event.max);
// The minimum sensing distance the sensor is
// able to report, in centimeters
console.log(event.min);
});
AMBIENT LIGHT
EVENTS
window.addEventListener("devicelight", function (event) {
// The lux values for "dim" typically begin below 50,
// and the values for "bright" begin above 10000
console.log(event.value);
});
Device Storage API
Browser API
TCP Socket API
Contacts API
systemXHR
PRIVILEGED APIS
DEVICE STORAGE
API
var deviceStorage = navigator.getDeviceStorage("videos");
// "external", "shared", or "default".
deviceStorage.type;
// Add a file - returns DOMRequest with file name
deviceStorage.add(blob);
// Same as .add, with provided name
deviceStorage.addNamed(blob, name);
// Returns DOMRequest/non-editable File object
deviceStorage.get(name);
// Returns editable FileHandle object
deviceStorage.getEditable(name);
// Returns DOMRequest with success or failure
deviceStorage.delete(name);
// Enumerates files
deviceStorage.enumerate([directory]);
// Enumerates files as FileHandles
deviceStorage.enumerateEditable([directory]);
var storage = navigator.getDeviceStorage("videos"),
cursor = storage.enumerate();
cursor.onerror = function() {
console.error("Error in DeviceStorage.enumerate()", cursor.error.name);
};
cursor.onsuccess = function() {
if (!cursor.result)
return;
var file = cursor.result;
// If this isn't a video, skip it
if (file.type.substring(0, 6) !== "video/") {
cursor.continue();
return;
}
// If it isn't playable, skip it
var testplayer = document.createElement("video");
if (!testplayer.canPlayType(file.type)) {
cursor.continue();
return;
}
};
WEB ACTIVITIES
Interacting with the camera
Firefox OS Introduction at Bontouch
var activity = new MozActivity({
name: "view",
data: {
type: "image/png",
url: ...
}
});
activity.onsuccess = function () {
console.log("Showing the image!");
};
activity.onerror = function () {
console.log("Can't view the image!");
};
{
"activities": {
"share": {
"filters": {
"type": ["image/png", "image/gif"]
}
"href": "sharing.html",
"disposition": "window"
}
}
}
navigator.mozSetMessageHandler("activity", function (a) {
var img = getImageObject();
img.src = a.source.url;
// Call a.postResult() or a.postError() if
// the activity should return a value
});
Future APIs
Firefox OS Introduction at Bontouch
Resource lock API
UDP Datagram Socket API
Peer to Peer API
WebNFC
WebUSB
HTTP-cache API
Calendar API
Spellcheck API
LogAPI
Keyboard/IME API
WebRTC
FileHandle API
Sync API
Web Apps from Mozilla
Firefox OS Introduction at Bontouch
Dialer
Contacts
Settings
SMS
Web browser
Gallery
Video Player
Music Player
E-mail (POP, IMAP)
Calendar
Alarm Clock
Camera
Notes
First Run Experience
Notifications
Home Screen
Mozilla Marketplace
System Updater
Localization Support
Firefox OS Introduction at Bontouch
Get started
https://addons.mozilla.org/firefox/addon/firefox-os-
simulator/
FIREFOX OS
BOILERPLATE APP
https://github.com/robnyman/Firefox-OS-Boilerplate-App
https://marketplace.firefox.com/
https://marketplace.firefox.com/developers/
Trying things out
Firefox OS Introduction at Bontouch
Firefox OS Introduction at Bontouch
Go have some fun!
Robert Nyman
robertnyman.com
robert@mozilla.com
Mozilla
@robertnyman

More Related Content

PDF
Mozilla, Firefox OS and the Open Web
PPTX
Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 201...
PPTX
Firefox OS - The platform you deserve - Athens App Days - 2013-11-27
PDF
Python Flask app deployed to OPenShift using Wercker CI
PDF
Crossing the Boundaries of Web Applications with OpenSocial
PDF
Drupal and Security: What You Need to Know
PPSX
Selenium WebDriver
PPT
Domino testing presentation
Mozilla, Firefox OS and the Open Web
Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 201...
Firefox OS - The platform you deserve - Athens App Days - 2013-11-27
Python Flask app deployed to OPenShift using Wercker CI
Crossing the Boundaries of Web Applications with OpenSocial
Drupal and Security: What You Need to Know
Selenium WebDriver
Domino testing presentation

What's hot (20)

PDF
Firefox OS, the Open Web & WebAPIs - HTML5DevConf, San Francisco
PDF
Python, WebRTC and You (v2)
PDF
A I R Presentation Dev Camp Feb 08
PPT
Domino security
PPTX
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
PPTX
PPTX
Powershell: Tu nuevo mejor amigo
PDF
IOS 11 setup with appium latest
DOC
Tutorial asp.net
PPT
Building Single Page Application (SPA) with Symfony2 and AngularJS
KEY
LvivPy - Flask in details
KEY
Automating Web Application Deployment
PDF
Webpack Encore Symfony Live 2017 San Francisco
PDF
What The Flask? and how to use it with some Google APIs
PDF
Quick flask an intro to flask
PDF
Develop and Run PHP on Windows. Say(Hello); to WordPress on Azure
PPT
Presentation (PPT)
PDF
Guzzle in Drupal 8 and as a REST client - Артем Мирошник
PPTX
Web deploy
PPT
Dance for the puppet master: G6 Tech Talk
Firefox OS, the Open Web & WebAPIs - HTML5DevConf, San Francisco
Python, WebRTC and You (v2)
A I R Presentation Dev Camp Feb 08
Domino security
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
Powershell: Tu nuevo mejor amigo
IOS 11 setup with appium latest
Tutorial asp.net
Building Single Page Application (SPA) with Symfony2 and AngularJS
LvivPy - Flask in details
Automating Web Application Deployment
Webpack Encore Symfony Live 2017 San Francisco
What The Flask? and how to use it with some Google APIs
Quick flask an intro to flask
Develop and Run PHP on Windows. Say(Hello); to WordPress on Azure
Presentation (PPT)
Guzzle in Drupal 8 and as a REST client - Артем Мирошник
Web deploy
Dance for the puppet master: G6 Tech Talk
Ad

Similar to Firefox OS Introduction at Bontouch (20)

PDF
WebRTC & Firefox OS - presentation at Google
PDF
Firefox OS, the Open Web & WebAPIs - Geek Meet Västerås
PDF
WebAPIs & WebRTC - Spotify/sthlm.js
PDF
Bringing the Open Web & APIs to 
mobile devices with Firefox OS, JSFoo, India
PDF
Bringing the Open Web & APIs to 
mobile devices with Firefox OS - GOTO confer...
PDF
Firefox OS learnings & visions, WebAPIs - budapest.mobile
PDF
Bringing the Open Web & APIs to 
mobile devices with Firefox OS - SpainJS
PDF
Bringing the Open Web & APIs to 
mobile devices with Firefox OS - BrazilJS
PDF
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
PDF
Firefox OS workshop, Colombia
PDF
Firefox OS
PDF
Firefox OS workshop, JSFoo, India
PDF
Bringing the Open Web & APIs to 
mobile devices with Firefox OS - Geek Meet
PDF
Fixing the mobile web - Internet World Romania
PPTX
Firefox OS Web APIs, taking it to the next level
PDF
Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28
PDF
HTML, not just for desktops: Firefox OS - Congreso Universitario Móvil - 201...
PDF
Web APIs & Apps - Mozilla
PDF
HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22
PDF
Firefox OS - A (mobile) Web Developers dream - DWX14
WebRTC & Firefox OS - presentation at Google
Firefox OS, the Open Web & WebAPIs - Geek Meet Västerås
WebAPIs & WebRTC - Spotify/sthlm.js
Bringing the Open Web & APIs to 
mobile devices with Firefox OS, JSFoo, India
Bringing the Open Web & APIs to 
mobile devices with Firefox OS - GOTO confer...
Firefox OS learnings & visions, WebAPIs - budapest.mobile
Bringing the Open Web & APIs to 
mobile devices with Firefox OS - SpainJS
Bringing the Open Web & APIs to 
mobile devices with Firefox OS - BrazilJS
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
Firefox OS workshop, Colombia
Firefox OS
Firefox OS workshop, JSFoo, India
Bringing the Open Web & APIs to 
mobile devices with Firefox OS - Geek Meet
Fixing the mobile web - Internet World Romania
Firefox OS Web APIs, taking it to the next level
Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28
HTML, not just for desktops: Firefox OS - Congreso Universitario Móvil - 201...
Web APIs & Apps - Mozilla
HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22
Firefox OS - A (mobile) Web Developers dream - DWX14
Ad

More from Robert Nyman (20)

PDF
Have you tried listening?
PDF
Building for Your Next Billion - Google I/O 2017
PDF
Introduction to Google Daydream
PDF
Predictability for the Web
PDF
The Future of Progressive Web Apps - View Source conference, Berlin 2016
PDF
The Future of the Web - Cold Front conference 2016
PDF
The Future of Progressive Web Apps - Google for Indonesia
PDF
Google tech & products
PDF
Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...
PDF
Progressive Web Apps keynote, Google Developer Summit, Tokyo, Japan
PDF
The web - What it has, what it lacks and where it must go - keynote at Riga D...
PDF
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...
PDF
The web - What it has, what it lacks and where it must go - Istanbul
PDF
The web - What it has, what it lacks and where it must go
PDF
Google, the future and possibilities
PDF
Developer Relations in the Nordics
PDF
What is Developer Relations?
PDF
Android TV Introduction - Stockholm Android TV meetup
PDF
New improvements for web developers - frontend.fi, Helsinki
PDF
Mobile phone trends, user data & developer climate - frontend.fi, Helsinki
Have you tried listening?
Building for Your Next Billion - Google I/O 2017
Introduction to Google Daydream
Predictability for the Web
The Future of Progressive Web Apps - View Source conference, Berlin 2016
The Future of the Web - Cold Front conference 2016
The Future of Progressive Web Apps - Google for Indonesia
Google tech & products
Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...
Progressive Web Apps keynote, Google Developer Summit, Tokyo, Japan
The web - What it has, what it lacks and where it must go - keynote at Riga D...
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...
The web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go
Google, the future and possibilities
Developer Relations in the Nordics
What is Developer Relations?
Android TV Introduction - Stockholm Android TV meetup
New improvements for web developers - frontend.fi, Helsinki
Mobile phone trends, user data & developer climate - frontend.fi, Helsinki

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PDF
Electronic commerce courselecture one. Pdf
PPT
Teaching material agriculture food technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Big Data Technologies - Introduction.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Cloud computing and distributed systems.
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
MYSQL Presentation for SQL database connectivity
Electronic commerce courselecture one. Pdf
Teaching material agriculture food technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Unlocking AI with Model Context Protocol (MCP)
Big Data Technologies - Introduction.pptx
The AUB Centre for AI in Media Proposal.docx
Dropbox Q2 2025 Financial Results & Investor Presentation
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
“AI and Expert System Decision Support & Business Intelligence Systems”
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
The Rise and Fall of 3GPP – Time for a Sabbatical?
Cloud computing and distributed systems.
MIND Revenue Release Quarter 2 2025 Press Release
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Review of recent advances in non-invasive hemoglobin estimation
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Advanced methodologies resolving dimensionality complications for autism neur...

Firefox OS Introduction at Bontouch