Más contenido relacionado La actualidad más candente (20) Similar a Firefox OS and the Internet of Things - NDC London 2014 (20) Firefox OS and the Internet of Things - NDC London 201422. Take the full content of the
Android App Store
Times 41,666
That’s the amount of pages on the
Google’able web (10-20% of full web)
24. Goal of the project
Building a smartphone for
the open web
29. A web page
Traditional model
Web
page Browser OS
30. A web page
Traditional model
Web
page Browser OS Kernel
31. A web page
Traditional model
Web
page Browser OS Kernel Phone
32. A web page
Firefox OS
Web
page Browser OS Kernel Phone
33. A web page
Firefox OS
Web
page Browser Kernel Phone
34. A web page
Firefox OS
Web
page Browser Kernel Phone
41. 1 var call = navigator.mozTelephony.dial('555123')
2
3 call.onconnected = function() {
4 call.hangUp()
5 }
57. Hide & Seek!
Hider sets up a WiFi hotspot
Seekers use dBm to triangulate
58. Hide & Seek!
1 var req = navigator.mozWifiManager.getNetworks();
2 req.onsuccess = function() {
3 var seeker = this.result.find(n => n.ssid === 'seeker');
4 if (!seeker) {
5 console.log('Too far out!');
6 }
7 else {
8 console.log(network.relSignalStrength);
9 }
10 };
60. Music
Theremin is instrument
Use device light as tone frequency
Wave your hands and magic!
61. Music
Theremin is instrument
Use device light as tone frequency
Wave your hands and magic!
62. Music
1 var context = new AudioContext();
2 var oscillator = context.createOscillator();
3 oscillator.connect(context.destination);
4 oscillator.start(0);
5
6 window.addEventListener('devicelight', function(e) {
7 oscillator.frequency.value = e.value * 10;
8 });
65. Track real life movement
Draw 3D model of phones
Measure gyroscope data
Show real life state on screen
67. Track real life movement
1 var front = new THREE.MeshBasicMaterial({ map: loadTexture('front.jpg') });
2 var back = new THREE.MeshBasicMaterial({ map: loadTexture('back.jpg') });
3 var border = new THREE.MeshBasicMaterial({ color: 0xffe04526 });
4
5 var materials = [ border, border, border,
6 border, front, back ];
7
8 var geometry = new THREE.BoxGeometry(2, 4, 0.3);
9 var cube = new THREE.Mesh(geometry,
10 new THREE.MeshFaceMaterial(materials));
11 scene.add(cube);
68. Track real life movement
1 window.addEventListener('deviceorientation', function(e) {
2 cube.rotation.x = e.beta / 60;
3 cube.rotation.y = e.gamma / 60;
4 cube.rotation.z = e.alpha / 60;
5 });
71. Juggling visualizer
1 window.addEventListener('devicemotion', function(e) {
2 var serie = getGraphSerieForDevice(e.data.deviceId);
3 serie.addPoint([ e.data.timestamp, Math.abs(e.data.z) ]);
4 });
116. JanOS
Alternative to Firefox OS
Some batteries included
Need rooted Firefox OS phone
with ADB enabled
!
github.com/janjongboom/janos
118. 1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta name="viewport" content="width=device-5 initial-scale=1">
6 <meta charset="utf-8">
7
8 <script src="js/bootstrap.js"></script>
9 <script defer src="js/camera.js"></script>
10 <script defer src="js/security_cam.js"></script>
11 <script defer src="js/doorbell.js"></script>
12 <script defer src="js/bluetooth.js"></script>
13 <script defer src="js/tracker.js"></script>
14 </head>
16 <body>
17 <h1>OMG WELCOME TO JANOS 1.0!</h1>
18 </body>
19 </html>
121. Taking picture to storage
1 window.camera.takePicture('front').then(function(blob) {
2 var storage = navigator.getDeviceStorage('pictures');
3 var req = storage.addNamed(blob,
'myawesomepicture.jpg');
4 req.onsuccess = function() {
5 console.log('Saved on internal storage!');
6 };
7 });
122. Taking picture to storage
1 window.camera.takePicture('front').then(function(blob) {
2 var storage = navigator.getDeviceStorage('pictures');
3 var req = storage.addNamed(blob,
'myawesomepicture.jpg');
4 req.onsuccess = function() {
5 console.log('Saved on internal storage!');
6 };
7 });
123. Taking picture to storage
1 window.camera.takePicture('front').then(function(blob) {
2 var storage = navigator.getDeviceStorage('pictures');
3 var req = storage.addNamed(blob,
'myawesomepicture.jpg');
4 req.onsuccess = function() {
5 console.log('Saved on internal storage!');
6 };
7 });
124. Taking picture to storage
1 window.camera.takePicture('front').then(function(blob) {
2 var storage = navigator.getDeviceStorage('pictures');
3 var req = storage.addNamed(blob,
'myawesomepicture.jpg');
4 req.onsuccess = function() {
5 console.log('Saved on internal storage!');
6 };
7 });
126. Bluetooth doorbell
1 enableBluetoothAudio('00:0C:8A:75:EF:30').then(function() {
2 window.onuserproximity = function(e) {
3 if (e.near) {
4 var audio = new Audio('/sounds/doorbell.ogg');
5 audio.play();
6 }
7 };
8 });
127. Bluetooth doorbell
1 enableBluetoothAudio('00:0C:8A:75:EF:30').then(function() {
2 window.onuserproximity = function(e) {
3 if (e.near) {
4 var audio = new Audio('/sounds/doorbell.ogg');
5 audio.play();
6 }
7 };
8 });
128. Bluetooth doorbell
1 enableBluetoothAudio('00:0C:8A:75:EF:30').then(function() {
2 window.onuserproximity = function(e) {
3 if (e.near) {
4 var audio = new Audio('/sounds/doorbell.ogg');
5 audio.play();
6 }
7 };
8 });
129. Bluetooth doorbell
1 enableBluetoothAudio('00:0C:8A:75:EF:30').then(function() {
2 window.onuserproximity = function(e) {
3 if (e.near) {
4 var audio = new Audio('/sounds/doorbell.ogg');
5 audio.play();
6 }
7 };
8 });
139. Get hacking
Grab a rootable FxOS phone
Crack it open
Write your own scripts
PROFIT!