Upload
noritada-shimizu
View
43.766
Download
8
Embed Size (px)
Citation preview
{ "name": "My App", "description": "My elevator pitch goes here", "launch_path": "/index.html", "icons": { "16": "/img/icon-16.png", … }, "developer": { "name": "Your name or organization", "url": "http://your-homepage-here.org" }, "default_locale": "ja"}
• 普通のFirefoxでも開発できますが、開発者が必要とする機能が充実しているため、こちらのほうが効率良く開発が行えます。
• https://mozilla.org/firefox/channel/ よりダウンロードできます
var sdcard = navigator.getDeviceStorage("sdcard");var file = new Blob(["This is a text file."], {type: "text/plain"});
var request = sdcard.addNamed(file, "my-file.txt");
request.onsuccess = function () { var name = this.result; console.log('File "' + name + '" successfully wrote on the sdcard storage area');}
// An error typically occur if a file with the same name already existrequest.onerror = function () { console.warn('Unable to write the file: ' + this.error);}
var name = navigator.mozCamera.getListOfCameras()[0];
var streamReady = function(stream){ var display = document.querySelector("video"); display.mozSrcObject = stream; display.play();};var success = function(camera){ camera.getPreviewStream(size, streamReady);};var fail = function(error){};
navigator.mozCameras.getCamera(name, {}, success, fail);
var req = new MozActivity({ name: "pick", data: { type: "audio/mpeg" }});req.onsuccess = success;
var success = function(){ var music = this.result;
// do something};