+ All Categories
Home > Technology > Front in recife

Front in recife

Date post: 06-May-2015
Category:
Upload: fabio-magnoni
View: 869 times
Download: 0 times
Share this document with a friend
Popular Tags:
80
#FirefoxOS Front In RECIFE
Transcript
Page 1: Front in recife

!

#FirefoxOS

Front In RECIFE !

Page 2: Front in recife

Fábio Magnoni

@FabioMagnoni

#FirefoxOS

Page 3: Front in recife
Page 4: Front in recife
Page 5: Front in recife
Page 6: Front in recife

http://www.unrealengine.com/html5/

Page 7: Front in recife
Page 8: Front in recife

GECKO

GAIA

GONK

Page 9: Front in recife

GONK

Page 10: Front in recife

Infrastructure Layer (Gonk)

RILd

AccelGPSCamera

Power Mgt

Audio /

Video

Open GLES

Input / Touch

Open Source Libraries

Bluetooth USB

LEDs HW

Buttons

Vibrator

OEM Libs

Device’s Operationg System

Linux Kernel OEM Drivers OEM Modem Firmware

Page 11: Front in recife

GECKO

Page 12: Front in recife

Open Web Platform Interface

Contacts

Sensors GeoLocation

Battery Vibration

Camera Media

Storage WebRTC

Alarms System

Messages

System XHR

NFC Bluetooth

WebTelephony WebSMS/MMSSettings

Gecko Engine

Security

Web APIs

Open WebApps APIs

Network Connections

/ UICC

mozPay /Trusted

UI

WebActivities

HTML5 APIs

Page 13: Front in recife

GAIA

Page 14: Front in recife

JS Libraries For Developers

Core - Certified

Apps System

AppUtility

Libraries Building Blocks

GaiaHosted Apps

Trusted Packed Apps

Application Layer HTML5 / JS / CSS

Page 15: Front in recife

Construindo Apps

Page 16: Front in recife

Apps Web Aberta

Page 17: Front in recife

A Web é a Plataforma

Page 18: Front in recife

Mobile Internet Users Desktop

Page 19: Front in recife

Plataformas !

Page 20: Front in recife

A Web está ganhando!!!

Page 21: Front in recife

{ "version": "1.0", "name": “Mozilla", "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/" } }, "pt-BR": { "description": "Descrição da sua aplicação!", "developer": { "url": "http://pt-BR.mozillalabs.com/" } } }, "default_locale": "en" }

Page 22: Front in recife

Verificador de Manifestohttp://appmanifest.org/

Page 23: Front in recife

Empacotadas vs. Hospedadas

Page 24: Front in recife

Segurança

Page 25: Front in recife

Apps

Conteúdo Web

Conteúdos Web Padrão

Web Apps Privilegiadas

Mais acesso, mais responsabilidade

Web Apps Instaladas

Web App Normal

Web App Certificada

Apps Críticas ao dispositivo

Page 26: Front in recife

Permissões

https://developer.mozilla.org/en-US/Apps/Developing/App_permissions

Page 27: Front in recife

"permissions": { "contacts": { "description": "Required for autocompletion in the share screen", "access": "readcreate" }, "alarms": { "description": "Required to schedule notifications" } }

Page 28: Front in recife
Page 29: Front in recife

WEB APIs

Page 30: Front in recife

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

WEB APIS (PRA GALERA)

Page 31: Front in recife

API STATUS DA BATERIA

Page 32: Front in recife

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

Page 33: Front in recife

NOTIFICAÇÃO

Page 34: Front in recife

var notification = navigator.mozNotification; notification.createNotification( "See this", "This is a notification", iconURL );

Page 35: Front in recife

API ORIENTAÇÃO DE TELA

Page 36: Front in recife

// Portrait mode: screen.mozLockOrientation("portrait"); /* Possible values: "landscape" "portrait" "landscape-primary" "landscape-secondary" "portrait-primary" "portrait-secondary" */

Page 37: Front in recife

API VIRAÇÃO

Page 38: Front in recife

// 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);

Page 39: Front in recife

API INFO DE REDE

Page 40: Front in recife

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

Page 41: Front in recife

PROXIMIDADE

Page 42: Front in recife

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

Page 43: Front in recife

API EVENTOS ILUMINAÇÃO

Page 44: Front in recife

window.addEventListener("devicelight", function (event) { // The level of the ambient light in lux console.log(event.value); });

Page 45: Front in recife

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

Page 46: Front in recife

Device Storage API

Browser API

TCP Socket API

Contacts API

systemXHR

WEB APIS (PRIVILEGIADAS)

Page 47: Front in recife

DEVICE STORAGE

Page 48: Front in recife

var deviceStorage = navigator.getDeviceStorage("videos");

Page 49: Front in recife

// "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]);

Page 50: Front in recife

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 51: Front in recife

API DE CONTATO

Page 52: Front in recife

var addContact = document.querySelector("#add-contact"); if (addContact) { addContact.onclick = function () { var newContact = new MozActivity({ name: "new", // Possibly add-contact in future versions data: { type: "webcontacts/contact", params: { // Will possibly move to be direct properties under "data" giveName: "Fabio", familyName: "Magnoni", tel: "+5519988013586", email: "[email protected]", address: "Campinas", note: “Se tiver cerveja envolvida, pode entrar em contato :)”, company: "Mozilla" } } }); } }

Page 53: Front in recife

Apps Certificadas = Apps SO

Page 54: Front in recife

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

Page 55: Front in recife

WEB ACTIVITIES

Page 56: Front in recife
Page 57: Front in recife

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!"); };

Page 58: Front in recife

{ "activities": { "share": { "filters": { "type": ["image/png", "image/gif"] } "href": "sharing.html", "disposition": "window" } } }

Page 59: Front in recife

var register = navigator.mozRegisterActivityHandler({ name: "view", disposition: "inline", filters: { type: "image/png" } }); register.onerror = function () { console.log("Failed to register activity"); }

Page 60: Front in recife

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

Page 61: Front in recife

Como instalar App da Web

var install app = navigator.mozApps.install(manifestURL); installapp.onsucess = function(data) { //App is installed };installapp.onerror = function() { //App wasn’t installed, info is in // installapp.error.name};

Page 62: Front in recife

APIs Futuras

Page 63: Front in recife

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

Page 65: Front in recife

https://marketplace.firefox.com/

Page 66: Front in recife

\o/ Documentos e Ferramentas \o/

Page 67: Front in recife

FIREFOX OS BOILERPLATE APP

https://github.com/robnyman/Firefox-OS-Boilerplate-App

Page 68: Front in recife

https://addons.mozilla.org/firefox/addon/firefox-os-simulator/

Page 69: Front in recife

http://buildingfirefoxos.com/

Page 70: Front in recife

https://developer.mozilla.org/en-US/docs/WebAPI

Page 72: Front in recife

https://hacks.mozilla.org/category/firefox-os/

Mozilla Developer Blog

Page 73: Front in recife

http://mozilla.github.io/brick/docs.html

Page 74: Front in recife

ComponentesAppbar !Calendar !Deck !Flipbox !Layout !Slideshow !Slider !Tabbar !Toggle !Tooltip

Page 75: Front in recife

https://appmaker.mozillalabs.com/

App Maker

Page 76: Front in recife

Pedindo Ajuda

Page 77: Front in recife
Page 78: Front in recife

https://lists.mozilla.org/listinfo/dev-webapps

irc://irc.mozilla.org/ #openwebapps


Recommended