0
Firefox OS, the Open Web & WebAPIs @robertnyman
“BemVindo”
Using HTML5, CSS and
JavaScript together with a
number of APIs to build
apps and customize the UI.
Firefox OS
Foxconn
Foxconn
Open Web Apps
HTML5 + manifest file (JSON)
{
"version": "1",
"name": "Firefox OS Boilerplate App",
"launch_path": "/index.html",
"description": "Boilerplate Firefox ...
Packaged & hosted apps
WebAPIs
Security Levels
Web Content
Regular web content
Installed Web App
A regular web app
Privileged Web App
More access, more responsibility
Ce...
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"
},...
PERMISSIONS
Vibration API (W3C)
Screen Orientation
Geolocation API
Mouse Lock API (W3C)
Open WebApps
Network Information API (W3C)
Bat...
VIBRATION API
// Vibrate for one second
navigator.vibrate(1000);
// Vibration pattern [vibrationTime, pause,…]
navigator.vibrate([200, 1...
DEVICEPROXIMITY
window.addEventListener("deviceproximity", function (event) {
// Current device proximity, in centimeters
console.log(even...
AMBIENT LIGHT
EVENTS
window.addEventListener("devicelight", function (event) {
// The lux values for "dim" typically begin below 50,
// and the...
PAGE VISIBILITY
document.addEventListener("visibilitychange", function () {
if (document.hidden) {
console.log("App is hidden");
}
else {
...
Device Storage API
Browser API
TCP Socket API
Contacts API
systemXHR
PRIVILEGED APIS
WEB ACTIVITIES
var activity = new MozActivity({
name: "view",
data: {
type: "image/png",
url: ...
}
});
activity.onsuccess = function () ...
{
"activities": {
"share": {
"filters": {
"type": ["image/png", "image/gif"]
}
"href": "sharing.html",
"disposition": "win...
Get started
https://addons.mozilla.org/firefox/addon/firefox-os-
simulator/
FIREFOX OS
BOILERPLATE APP
https://github.com/robnyman/Firefox-OS-Boilerplate-App
APP MANAGER
Robert Nyman
robertnyman.com
robert@mozilla.com
Mozilla
@robertnyman
Firefox OS, the Open Web & WebAPIs - LXJS, Portugal
Firefox OS, the Open Web & WebAPIs - LXJS, Portugal
Firefox OS, the Open Web & WebAPIs - LXJS, Portugal
Firefox OS, the Open Web & WebAPIs - LXJS, Portugal
Firefox OS, the Open Web & WebAPIs - LXJS, Portugal
Firefox OS, the Open Web & WebAPIs - LXJS, Portugal
Firefox OS, the Open Web & WebAPIs - LXJS, Portugal
Firefox OS, the Open Web & WebAPIs - LXJS, Portugal
Firefox OS, the Open Web & WebAPIs - LXJS, Portugal
Firefox OS, the Open Web & WebAPIs - LXJS, Portugal
Firefox OS, the Open Web & WebAPIs - LXJS, Portugal
Upcoming SlideShare
Loading in...5
×

Firefox OS, the Open Web & WebAPIs - LXJS, Portugal

2,358

Published on

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,358
On Slideshare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Firefox OS, the Open Web & WebAPIs - LXJS, Portugal"

  1. 1. Firefox OS, the Open Web & WebAPIs @robertnyman
  2. 2. “BemVindo”
  3. 3. Using HTML5, CSS and JavaScript together with a number of APIs to build apps and customize the UI. Firefox OS
  4. 4. Foxconn
  5. 5. Foxconn
  6. 6. Open Web Apps
  7. 7. HTML5 + manifest file (JSON)
  8. 8. { "version": "1", "name": "Firefox OS Boilerplate App", "launch_path": "/index.html", "description": "Boilerplate Firefox OS app", "icons": { "16": "/images/logo16.png", "32": "/images/logo32.png", "48": "/images/logo48.png", "64": "/images/logo64.png", "128": "/images/logo128.png" }, "developer": { "name": "Robert Nyman", "url": "http://robertnyman.com" }, "installs_allowed_from": ["*"], "default_locale": "en" }
  9. 9. Packaged & hosted apps
  10. 10. WebAPIs
  11. 11. Security Levels
  12. 12. 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
  13. 13. https://wiki.mozilla.org/ WebAPI#Planned_for_initial_release_of_B2G_.28aka_Basecamp.29
  14. 14. "permissions": { "contacts": { "description": "Required for autocompletion in the share screen", "access": "readcreate" }, "alarms": { "description": "Required to schedule notifications" } }
  15. 15. PERMISSIONS
  16. 16. 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
  17. 17. VIBRATION API
  18. 18. // 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);
  19. 19. DEVICEPROXIMITY
  20. 20. 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); });
  21. 21. AMBIENT LIGHT EVENTS
  22. 22. 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); });
  23. 23. PAGE VISIBILITY
  24. 24. document.addEventListener("visibilitychange", function () { if (document.hidden) { console.log("App is hidden"); } else { console.log("App has focus"); } });
  25. 25. Device Storage API Browser API TCP Socket API Contacts API systemXHR PRIVILEGED APIS
  26. 26. WEB ACTIVITIES
  27. 27. 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!"); };
  28. 28. { "activities": { "share": { "filters": { "type": ["image/png", "image/gif"] } "href": "sharing.html", "disposition": "window" } } }
  29. 29. Get started
  30. 30. https://addons.mozilla.org/firefox/addon/firefox-os- simulator/
  31. 31. FIREFOX OS BOILERPLATE APP https://github.com/robnyman/Firefox-OS-Boilerplate-App
  32. 32. APP MANAGER
  33. 33. Robert Nyman robertnyman.com robert@mozilla.com Mozilla @robertnyman
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×