Piotr Zalewa, @zalun
{
"name": "My App",
"description": "My elevator pitch goes here",
"launch_path": "/",
"icons": { "128": "/img/icon-128.png" },
"developer": {
"name": "Your name or organization",
"url": "http://your-homepage-here.org"
}
}
function ambientCallback(ambient) {
// do something with ambient.value
}
window.addEventListener('devicelight',
ambientCallback, false);
Hosted
stored on your server, easy to upgrade, limited access
Privileged
reviewed by the App store, packaged and signed
Certified
part of the OS, only for Mozilla and partners
var call = new MozActivity({
name: "dial",
data: {
number: "+1804100100"
}
});
var getphoto = new MozActivity({
name: "pick",
data: {
type: ["image/png",
"image/jpg",
"image/jpeg"]
}
});
getphoto.onsuccess = function () {
var img = document.createElement("img");
img.src = window.URL.createObjectURL(this.result.blob);
body.appendChild(img);
};
getphoto.onerror = function () { // error
};
Go into settings and
Device Information > More Information > Developer
Switch on the Remote debugging
Linux users should also configure udev rule
adb logcat | grep JS
Add a component
<x-flipbox>
<div>I'm the front face.</div>
<div>And I'm the back face.</div>
</x-flipbox>
Use extended element in Javascript
toggleButton.addEventListener("click", function(){
flipBox.toggle();
});
/webapp.manifest
to your Fiddle URL and paste this link into the Firefox OS simulator to install the app/fxos.html
to your Fiddle URL to get an install page like a typical Firefox OS hosted applicationvar installApp = navigator.mozApps.install(manifestURL);
installApp.onsuccess = function(data) {
// App is installed
};
installApp.onerror = function() {
// App wasn't installed, info is in
// installApp.error.name
};
navigator.mozPay()
using signed JWT