Firefox OS

First Class Mobile Web

Nick Desaulniers

Nick Desaulniers

Software Engineer @ Mozilla

3rd Party App Support

Simulator Core

Rust Contributor

What is Firefox OS?

Firefox OS is a free open source operating system for mobile devices being developed by Mozilla, telecom operators, handset and chipset manufacturers, and volunteers.


Firefox OS looks to be there for the next two billion people connecting to the web, through low cost mobile devices.

What is Firefox OS made of?

Gaia

Gecko

Gonk

What does it take to make an app?

  1. Decide on a packaging model.
  2. Create a manifest file.
  3. Serve manifest with right MIME type.

Packaging Models

  • Hosted
  • Packaged
    • Web
    • Privileged
    • Certified


The choice of packaging model comes down to need for Device APIs and hosting of assets.

Packaged vs Hosted

Assets of packaged apps are zipped. Device APIs require packaging for security and review. Packaging an app can also be done to avoid hosting.

Privileged (Packaged)

"I would like to use a privileged device API." Subject to CSP.

Web (Packaged)


"I'm not interested in device APIs, but I would prefer to avoid hosting."

Hosted

"I'm not interested in device APIs, and I'm cool with hosting assets somewhere."

Most apps will probably fall under this category (ie. existing mobile web apps).

Certified (Packaged)

Mozilla and carriers only. Typically because APIs are sensitive or unstable.

Permissions
Permissions Matrix (MDN)

One App Per Origin

Apps are differentiated by their origin. Origin = protocol + subdomain + domain + port

Manifest

JSON encoded file that tells the OS about your app.

App Manifest (MDN)
{
  "name": "Firefox OS Presentation",
  "version": "0.1",
  "description": "My Presentation",
  "developer": {
    "name": "Nick Desaulniers",
    "url": "https://nickdesaulniers.github.io"
  },
  "icons": {
    "60": "/60.png",
    "128": "/128.png"
  },
  "fullscreen": true
}

Manifest MIME Type

Manifest must be served with MIME type:

application/x-web-app-manifest+json

Manifest is JSON

Make sure your manifest is valid JSON! I recommend always double checking with JSONLint.

Github Pages

Github will serve your manifest with the right mime type, so you can host an app from Github!

Dev Tools

Reference Docs

Monetize Your App

Paid Apps

Apps receive a receipt when installed. Mozilla provides verification service.

In App Payments

  1. Client Requests JWT from server
  2. navigator.mozPay(jwt);
  3. Mozilla Service contacts server
  4. Server transfers content


Authenticate with Persona

Mozilla Persona is a cross-browser login system for the Web that's easy to use and easy to deploy. Not required for Firefox OS.

Web Activities

Useful for inter-app communication. Listen for or invoke different activities.

Docs (MDN)

Personal Observations

  • Don't assume connectivity.
  • Bandwidth is not free.
  • No browser-chrome.
  • Small inputs hurt.
  • Target mobile first, then add content.
  • Localize all strings!

Questions?

Thanks!

Let me know what you thought about this talk.