firefox os-introduction

71
Firefox OS Lengyel Zsolt zsolt.lengyel.it@gma il.com

Upload: zsoltlengyelit

Post on 06-May-2015

805 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Firefox os-introduction

Firefox OSLengyel Zsolt

[email protected]

Page 2: Firefox os-introduction

Bringing the Open Web to Mobile Devices OS

Bringing the Open Web to Mobile Devices OS

Page 3: Firefox os-introduction

Bringing The Boot to Gecko project was launched to enable the Open Web as a platform for mobile devices. We’re making innovation possible by driving the development of new Web standards.

Bringing The Boot to Gecko project was launched to enable the Open Web as a platform for mobile devices. We’re making innovation possible by driving the development of new Web standards.

Page 4: Firefox os-introduction

Operators and developers write apps and services for one platform and

then rewrite them for others. Users who want to buy phones, e-readers and game consoles from different manufacturers often need to re-purchase apps for each device.

Operators and developers write apps and services for one platform and

then rewrite them for others. Users who want to buy phones, e-readers and game consoles from different manufacturers often need to re-purchase apps for each device.

Page 5: Firefox os-introduction

Opportunities for Developers

Opportunities for Developers

Page 6: Firefox os-introduction

Using HTML5 and the new Mozilla-proposed standard APIs, developers

everywhere will be able to create amazing experiences and apps.

Developers will no longer need to learn and develop against platform-

specific native APIs.

Using HTML5 and the new Mozilla-proposed standard APIs, developers

everywhere will be able to create amazing experiences and apps.

Developers will no longer need to learn and develop against platform-

specific native APIs.

Page 7: Firefox os-introduction

Customization for OEMs & OperatorsCustomization for OEMs & Operators

Page 8: Firefox os-introduction

OEMs and operators will be able to provide content and services across

their entire device portfolio, regardless of OS. And they will be able

to customize user experiences, manage app distribution and retain

customer attention, loyalty and billing relationships.

OEMs and operators will be able to provide content and services across

their entire device portfolio, regardless of OS. And they will be able

to customize user experiences, manage app distribution and retain

customer attention, loyalty and billing relationships.

Page 9: Firefox os-introduction

Consumer FreedomConsumer Freedom

Page 10: Firefox os-introduction

Consumers who use devices based on the Open Web platform will be able to easily access and download their own content regardless of which OS they use.

Consumers who use devices based on the Open Web platform will be able to easily access and download their own content regardless of which OS they use.

Page 11: Firefox os-introduction

New Web StandardsNew Web Standards

Page 12: Firefox os-introduction

Firefox OS produces an implementation of these new Web standards to free

mobile platforms from the encumbrances of the rules and restrictions of existing

proprietary platforms.

Firefox OS produces an implementation of these new Web standards to free

mobile platforms from the encumbrances of the rules and restrictions of existing

proprietary platforms.

Page 13: Firefox os-introduction

ComponentsComponents

Page 14: Firefox os-introduction

GONKGONK

GECKOGECKO

GAIA

GAIA

APPSAPPS

Page 15: Firefox os-introduction

GONKGONK

Page 16: Firefox os-introduction

Lower level operating system, consisting of a Linux kernel and HAL

(Hardware Abstraction Layer).

Possibility to expose anything from the hardware to Gecko.

Lower level operating system, consisting of a Linux kernel and HAL

(Hardware Abstraction Layer).

Possibility to expose anything from the hardware to Gecko.

Page 17: Firefox os-introduction

GECKOGECKO

Page 18: Firefox os-introduction

The application runtime.The rendering engine in Firefox for

HTML5, CSS & JavaScript.

Implements a number of APIs.

The application runtime.The rendering engine in Firefox for

HTML5, CSS & JavaScript.

Implements a number of APIs.

Page 19: Firefox os-introduction

GAIAGAIA

Page 20: Firefox os-introduction
Page 21: Firefox os-introduction

The user interface.

Built entirely by HTML5 & Open Web APIs.

The user interface.

Built entirely by HTML5 & Open Web APIs.

Page 22: Firefox os-introduction

Web APIsWeb APIs

Page 23: Firefox os-introduction

The Boot to Gecko project is based entirely on open standards and the

source code is open and accessible to all.

Where open standards are missing, we're working with standards bodies and other

vendors to create them.

The Boot to Gecko project is based entirely on open standards and the

source code is open and accessible to all.

Where open standards are missing, we're working with standards bodies and other

vendors to create them.

Page 24: Firefox os-introduction

WEBTELEPHONYWEBTELEPHONY

Page 25: Firefox os-introduction

// Telephony objectvar tel = navigator.mozTelephony;

// Check if the phone is muted (read/write property)console.log(tel.muted);

// Check if the speaker is enabled (read/write property)console.log(tel.speakerEnabled);

Page 26: Firefox os-introduction

// Place a callvar cal = tel.dial(“123456789”);

Page 27: Firefox os-introduction

// Events for that callcall.onstatechange = function (event) { /* Possible values for state: "dialing", "ringing", "busy", "connecting", "connected", "disconnecting", "disconnected", "incoming" */ console.log(event.state);};

// Above options as direct eventscall.onconnected = function () { // Call was connected};

call.ondisconnected = function () { // Call was disconnected};

Page 28: Firefox os-introduction

// Receiving a calltel.onincoming = function (event) { var incomingCall = event.call;

// Get the number of the incoming call console.log(incomingCall.number);

// Answer the call incomingCall.answer();};

// Disconnect a callcall.hangUp();

// Iterating over calls, and taking action depending on their changed statustel.oncallschanged = function (event) { tel.calls.forEach(function (call) { // Log the state of each call console.log(call.state); });};

Page 29: Firefox os-introduction

WEBSMSWEBSMS

Page 30: Firefox os-introduction

// SMS objectvar sms = navigator.mozSMS;

// Send a messagesms.send("123456789", "Hello world!");

Page 31: Firefox os-introduction

// Recieve a messagesms.onreceived = function (event) { // Read message console.log(event.message);};

Page 32: Firefox os-introduction

BATTERY STATUS APIBATTERY STATUS API

Page 33: Firefox os-introduction

var battery = navigator.mozBatteryif (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); }

Page 34: Firefox os-introduction

VIBRATION APIVIBRATION API

Page 35: Firefox os-introduction

// Vibrate for one secondnavigator.mozVibrate(1000);

// Vibration pattern [vibrationTime, pause,…]navigator.mozVibrate([200, 100, 200, 100]);

// Vibrate for 5 secondsnavigator.mozVibrate(5000);

// Turn off vibrationnavigator.mozVibrate(0);

Page 36: Firefox os-introduction

CONTACTS APICONTACTS API

Page 37: Firefox os-introduction

var contact = new mozContact();contact.init({name: "Tom"});

var request = navigator.mozContacts.save(contact);request.onsuccess = function() { console.log("Success");};

request.onerror = function() { console.log("Error")};

Page 38: Firefox os-introduction

SETTINGS APISETTINGS API

Page 39: Firefox os-introduction

var settings = window.navigator.mozSettings;settings.getLock().set({"background": "pretty.png"});

Page 40: Firefox os-introduction

DEVICE STORAGE APIDEVICE STORAGE API

Page 41: Firefox os-introduction

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; }}

Page 42: Firefox os-introduction

SCREENORIENTATION API

SCREENORIENTATION API

Page 43: Firefox os-introduction

// Portrait mode:screen.mozLockOrientation("portrait");

/* Possible values: "landscape" "portrait" "landscape-primary" "landscape-secondary" "portrait-primary" "portrait-secondary"*/

Page 44: Firefox os-introduction

NETWORK INFORMATION API

NETWORK INFORMATION API

Page 45: Firefox os-introduction

var connection = window.navigator.mozConnection, online = connection.bandwidth > 0, metered = connectrion.metered;

Page 46: Firefox os-introduction

KEYBOARD/IME APIKEYBOARD/IME API

Page 47: Firefox os-introduction

var keyboard = window.navigator.mozKeyboard;keyboard.sendKey(0, keyCode);

Page 48: Firefox os-introduction

Web Apps from MozillaWeb Apps from Mozilla

Page 49: Firefox os-introduction
Page 50: Firefox os-introduction

CERTIFIED

PRIVILEGED

HOSTED

Vibration API, Screen Orientation, Geolocation API, Mouse Lock API, Open WebApps, Network Information API, Battery Status API, Alarm API, Push Notifications API, WebFM API / FMRadio, WebPayment, IndexedDB, Ambient light sensor, Proximity sensor, Notification

Device Storage APIBrowser API

TCP Socket APIContacts APIsystemXHR

WebTelephony, WebSMS, Idle API, Settings API, Power Management API, Mobile Connection API, WiFi Information API, WebBluetooth, Permissions API, Network Stats API, Camera API, Time/Clock API, Attention screen, Voicemail

Security LevelsSecurity Levels

Page 51: Firefox os-introduction

Writing Apps, Mozilla Marketplace

Page 52: Firefox os-introduction
Page 53: Firefox os-introduction
Page 54: Firefox os-introduction

Web apps are apps built using standard Web technologies. They work in any modern Web browser, and can be developed using your favorite tools.

The Open Web apps project proposes some small additions to existing sites to turn them into apps that run in a rich, fun, and powerful computing environment.

These apps run on desktop browsers and mobile devices, and are easier for a user to discover and launch than Web sites.

Page 55: Firefox os-introduction

Steps to TakeSteps to Take

Page 56: Firefox os-introduction

Develop Web App using HTML5, CSS, & Javascript1.

Create an app manifest file2.

Publish/install the app3.

Page 57: Firefox os-introduction

1. Develop Web App using HTML5, CSS & JavaScript

Page 58: Firefox os-introduction

Reuse any existing web site/app or develop from scratch with open web standards.

Utilize HTML5 features such as localStorage, offline manifest, IndexedDB and access Web APIs for more options.

Responsive web design for adapting to varying resolutions and screen orientation.

Page 59: Firefox os-introduction

2. Create an app manifest file

Page 60: Firefox os-introduction

Create a file with a .webapp extensionCreate a file with a .webapp extension

Page 61: Firefox os-introduction

{ "version": "1.0", "name": "MozillaBall", "description": "Exciting Open Web development action!", "icons": { "16": "/img/icon-16.png", "48": "/img/icon-48.png", "128": "/img/icon-128.png" }, "developer": { "name": "Mozilla Labs", "url": "http://mozillalabs.com" }, "installs_allowed_from": ["*"], "appcache_path": "/cache.manifest", "locales": { "es": { "description": "¡Acción abierta emocionante del desarrollo del Web!", "developer": { "url": "http://es.mozillalabs.com/" } }, "it": { "description": "Azione aperta emozionante di sviluppo di fotoricettore!", "developer": { "url": "http://it.mozillalabs.com/" } } }, "default_locale": "en"}

Page 62: Firefox os-introduction

MANIFEST CHECKER

Page 63: Firefox os-introduction

3. Publish/install the app

Page 64: Firefox os-introduction

Mozilla MarketplaceMozilla Marketplace

Page 65: Firefox os-introduction
Page 66: Firefox os-introduction

Installing/hosting the appInstalling/hosting the app

Page 67: Firefox os-introduction

var request = navigator.mozApps.install( "http://mozillalabs.com/MozillaBall.webapp", { user_id: "some_user" });

request.onsuccess = function() { // Success! Notification, launch page etc}

request.onerror = function() { // Failed. this.error.name has details}

Page 68: Firefox os-introduction

Development tools

Page 69: Firefox os-introduction

Your favourite tools

Page 70: Firefox os-introduction

App Manager

Page 71: Firefox os-introduction

Questions

Thank you for your attention!