On Github MedMack / Intro_FirefoxOS
by Med Manai ( aka Mack ) - Mozilla Tunisia Team
Un système d'exploitation open source développé par Mozilla pour les smartphones ( +tablettes ) basé sur les nouvelles technologies du Web
index.html
<body> <h3>Hello World ! :)</h3> </body>
manifest.webapp
{ "name":"Hello World", "description":"Hello world pour le workshop Netlinks Event", "launch_path":"/index.html", "developer": { "name":"medmack", "url":"http://github.com/MedMack" }, "default_locale":"en" }
var battery = navigator.battery; battery.level; battery.charging; battery.chargingTime; battery.dischargingTime;
battery.addEventListener("levelchange", myEventHandler, false); battery.addEventListener("chargingchange", myEventHandler, false); battery.addEventListener("chargintimechange", myEventHandler, false); battery.addEventListener("dischargingtimechange", myEventHandler, false);
navigator.vibrate(100); navigator.vibrate([100,50,200]); navigator.vibrate(0); navigator.vibrate([]);
var myNotification = navigator.mozNotification.createNotification( "Hello", "Juste pour dire salut :p", iconURL); //myNotification.onclick = function () {} //myNotification.onclose = function () {} myNotification.show();
"permissions":{ "desktop-notification":{ "description":"Accès aux notification" } }
window.addEventListener('deviceproximity', myEventHandler); function myEventHandler(event){ var val = event.value; var max = event.max; var min = event.min; //TODO }
"permissions":{ "background-sensor":{ } }
var tel = navigator.mozTelephony; var muted = tel.muted; //modifiable var speakers = tel.speackerEnabled; // modifiable var unAppel = tel.dial("+21650123456"); unAppel.hangUp(); tel.onincoming = function(event){ var appel = event.call; var num = appel.number; appel.anwser(); };
telephony
var sms = navigator.mozSMS; sms.send("+21650123456", "Bonjour :)"); sms.onreveived = function (event){ var msg = event.message; };
sms