#firefoxos js-meetup

43
FIREFOX OS Nagy Gergő gergo.istvan.nagy [at] mozilla [dot] hu Budapest.js – javascript meetup 2013.06.17.

Upload: daf182

Post on 12-May-2015

184 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: #FirefoxOS js-meetup

FIREFOX OS

Nagy Gergőgergo.istvan.nagy [at] mozilla [dot] huBudapest.js – javascript meetup2013.06.17.

Page 2: #FirefoxOS js-meetup
Page 3: #FirefoxOS js-meetup
Page 4: #FirefoxOS js-meetup

Operating System

Page 5: #FirefoxOS js-meetup

https://mdn.mozillademos.org/files/4605/FirefoxOS.png

Page 6: #FirefoxOS js-meetup

Web Applications

Page 7: #FirefoxOS js-meetup

+ Web APIs

Page 8: #FirefoxOS js-meetup
Page 9: #FirefoxOS js-meetup

Development

Page 10: #FirefoxOS js-meetup

APIs

• for telephony• for device handling• for standard web development

Page 11: #FirefoxOS js-meetup

What APIs are available for my application?

Page 12: #FirefoxOS js-meetup

• Hosted application• Privileged apps• Certified apps

Page 13: #FirefoxOS js-meetup

What is the situation with the camera?

Page 14: #FirefoxOS js-meetup

Is there any way to get a photo with my application?

Page 15: #FirefoxOS js-meetup

Application bus

MozActivities

Similar to Intents on Android

Page 16: #FirefoxOS js-meetup

var activity = new MozActivity({ name: "pick", data: { type: "image/jpeg" }});

Page 17: #FirefoxOS js-meetup

Custom activities to work together with third party apps!

https://github.com/daf182/moz-activity

Page 18: #FirefoxOS js-meetup

Manifest files

Page 19: #FirefoxOS js-meetup

appcache

open web app

Page 20: #FirefoxOS js-meetup

appcache

cache.manifest

Page 21: #FirefoxOS js-meetup

open web app

manifest.webapp

Page 22: #FirefoxOS js-meetup

Three way of testing:

• Use a real phone• Use the simulator• Use the emulator (r2d2b2g)

Page 23: #FirefoxOS js-meetup

The easiest way is the esimulator:

• available as simple Firefox Add-on• manifest file validation• remote debugging• remote console• push to device

Page 24: #FirefoxOS js-meetup
Page 25: #FirefoxOS js-meetup

Let's write the application!

Hello world!

Page 26: #FirefoxOS js-meetup

Application development steps

• edit html and css files to create UI• implement application logic in javascript• write manifest for the OS• open your manifest in the simulator

Page 27: #FirefoxOS js-meetup

<!DOCTYPE html><html> <head> <title>Hello meetup!</title> </head> <body> <h1>

Hello Budapest JS meetup! </h1>

</body></html>

Page 28: #FirefoxOS js-meetup

{ "version": "0.1", "name": "HelloBPJS", "description": "Firefox OS Open Web App", "launch_path": "/index.html", "developer": { "name": "Gergo Nagy" },

"icons": { "60" : "/image/icons/icon-60.png"

}}

Page 29: #FirefoxOS js-meetup
Page 30: #FirefoxOS js-meetup

What about the stylessheets?

Page 31: #FirefoxOS js-meetup
Page 32: #FirefoxOS js-meetup
Page 33: #FirefoxOS js-meetup

Documentation

Page 34: #FirefoxOS js-meetup
Page 35: #FirefoxOS js-meetup

Marketplace

Page 36: #FirefoxOS js-meetup
Page 37: #FirefoxOS js-meetup

Publication methods

• Hosted apps• Packaged apps

Page 38: #FirefoxOS js-meetup
Page 39: #FirefoxOS js-meetup

The final demo!

Page 40: #FirefoxOS js-meetup

https://github.com/daf182/shake2bounce

Page 41: #FirefoxOS js-meetup

Thanks for watching!

Page 42: #FirefoxOS js-meetup

Links

Page 43: #FirefoxOS js-meetup

https://github.com/mozilla/r2d2b2ghttps://developer.mozilla.org/en-US/docs/WebAPIhttps://developer.mozilla.org/en-US/docs/Web/Apps/App_permissions?redirectlocale=en-US&redirectslug=Apps%2FApp_permissionshttps://marketplace.firefox.com/developers/docs/quick_starthttps://marketplace.firefox.com/http://www.mozilla.org/en-US/styleguide/products/firefoxos/icons/http://buildingfirefoxos.com/