welcome firefox os in india with your app - mumbai firefox os hackathon - 2014-06-25
DESCRIPTION
TRANSCRIPT
![Page 1: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/1.jpg)
Welcome Firefox OS
Mumbai Firefox OS Hackathon
to India with your app
2014-06-25
Frédéric HarperSr. Technical Evangelist @ Mozilla@fharper | outofcomfortzone.net
![Page 2: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/2.jpg)
![Page 3: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/3.jpg)
![Page 4: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/4.jpg)
Firefox OS
![Page 5: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/5.jpg)
![Page 6: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/6.jpg)
Built with the Web
Using HTML5, CSS3 and
JavaScript
with a number of APIs
to build apps.
![Page 7: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/7.jpg)
It’s open source
![Page 8: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/8.jpg)
Some facts
7 operator (17 committed) & 4 hardware partners
ZTE Open, Alcatel One Touch Fire, Geeksphone
Keon, Geeksphone Peak, LG FireWeb…
More to come: Flame, Huawei Y300, ZTE Open C,
Alcatel One Touche Fire C & E & S…
Aimed at emerging markets/low end market
![Page 9: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/9.jpg)
![Page 10: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/10.jpg)
A Firefox OS app?
Creating a hosted or packaged app
Using
Vanilla HTML5
Librairies…
Regular API
Privileged API
Certified API
![Page 11: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/11.jpg)
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"
}
}
}
![Page 12: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/12.jpg)
DEMO App Manager + Emberjs todomvc
![Page 13: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/13.jpg)
Web APIs
![Page 14: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/14.jpg)
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
![Page 15: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/15.jpg)
Ambient Light Sensor
![Page 16: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/16.jpg)
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);
});
![Page 17: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/17.jpg)
DEMO Boilerplate – Ambient Light Sensor
![Page 18: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/18.jpg)
Battery Status
![Page 19: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/19.jpg)
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);
}
![Page 20: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/20.jpg)
DEMO Boilerplate – Battery status
![Page 21: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/21.jpg)
Web APIs – Privileged
• Browser API• Contacts API• Device Storage API• systemXHR• TCP Socket API
packaged
![Page 22: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/22.jpg)
Browser
![Page 23: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/23.jpg)
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>
![Page 24: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/24.jpg)
Browser
addEventListener('mozbrowserloadstart', function(e) {
//Do stuff
});
/*
Possible values:
"mozbrowserloadstart“ "mozbrowserloadend"
"mozbrowserlocationchange“ "mozbrowsertitlechange"
"mozbrowsericonchange“ "mozbrowsersecuritychange"
"mozbrowsercontextmenu“ "mozbrowsererror"
"mozbrowserkeyevent“ "mozbrowsershowmodalprompt"
"mozbrowseropenwindow“ "mozbrowserclose"
*/
![Page 25: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/25.jpg)
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
![Page 26: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/26.jpg)
Web Activities
![Page 27: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/27.jpg)
Web Activities
• browse• configure• costcontrol• dial• Open• new
• mail• websms/sms• webcontacts/contact
• pick• record• save-bookmark• share• view• update
packaged
hosted
![Page 28: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/28.jpg)
Pick
var activity = new MozActivity({
name: "pick",
//Provide the data required
//by the filter of the activity
data: {
type: "image/jpeg"
}
});
![Page 29: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/29.jpg)
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
};
![Page 30: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/30.jpg)
Dial
var call = new MozActivity({
name: "dial",
data: {
number: "+46777888999"
}
});
![Page 31: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/31.jpg)
Web Activity Received Handler
"activities": {
"pick": {
"filters": {
"type": ["image/jpeg", "image/png"]
},
"disposition": "inline",
"returnValue": true,
"href": "/index.html#pick"
}
}
![Page 32: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/32.jpg)
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");
}
}
});
![Page 33: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/33.jpg)
Creative Commons: http://j.mp/1iZHGAW
![Page 34: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/34.jpg)
How to start
![Page 35: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/35.jpg)
The next presentations
![Page 36: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/36.jpg)
![Page 37: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/37.jpg)
![Page 38: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/38.jpg)
Creative Commons: http://j.mp/1gIdcPF
To infinity, and beyond…
![Page 39: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/39.jpg)
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
![Page 40: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/40.jpg)
Help get quality Indian appsHelp Firefox OS be the #1 platform in India!
![Page 41: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/41.jpg)
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
![Page 42: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/42.jpg)
Free phone!
http://j.mp/mozFlame
Creative Commons: https://flic.kr/p/epEL3n
![Page 43: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/43.jpg)
etherpad.mozilla.org/
mumbaifxoshackathon
![Page 44: Welcome Firefox OS in india with your app - Mumbai Firefox OS hackathon - 2014-06-25](https://reader033.vdocument.in/reader033/viewer/2022061119/546b15a8af7959221d8b6770/html5/thumbnails/44.jpg)
Need help with translation!
Hindi, Tamil & Bengali
Connect A2 Captain Rogers Drawl
http://mzl.la/howTransifex