Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Resources to Start Developing for Firefox OS

Resources to Start Developing for Firefox OS

This item in japanese

Lire ce contenu en français

Firefox OS, developed by Mozilla, pursues “the goal of building a complete, standalone operating system for the open web” and lets users install and run applications created using HTML, CSS, and JavaScript. It is based on Linux and Mozilla's Gecko and is a completely open stack that is 100 per cent free from proprietary technology.

Contributing to Firefox OS

Firefox OS is fully open source and can be cloned from GitHub. On Mozilla Developer's portal, you can find fully detailed instructions to build and install it on an emulator or mobile device, e.g., an Android handset configured for dual boot.

Firefox OS core technologies are organized in three major layers:

  • Gaia, which is the user interface of Firefox OS. Gaia includes, among other things, a lock/home screen, telephone dialer and contacts application, plus the classic phone apps: mail, calendar, calculator and marketplace. Gaia is written entirely in HTML, CSS, and JavaScript.
  • Gecko, which is the OS application runtime and implements open standards for HTML, CSS, and JavaScript. Gecko includes a networking stack, graphics stack, layout engine, and JavaScript virtual machine.
  • Gonk, which consists of a Linux kernel and a user-space hardware abstraction layer (HAL) and is the lower level OS on which Gecko runs. Gonk exposes to Gecko interfaces to get, e.g., direct access to the full telephony stack or to the display framebuffer, which are not usually accessible to Gecko on any other OS.

Among the skills required to contribute to Gonk and Gecko is knowledge of C++, while knowledge of JavaScript or HTML/CSS is required to be able to contribute to Gaia.

A fundamental resource for contributing to Firefox OS is bugzilla, Mozilla's defect database. Apart from choosing and fixing any bug from bugzilla, Mozilla has made an effort to help newcomers to get acquainted with the platform and processes by establishing mentored bugs. Mentored bugs should contain enough information to get started and also feature a mentor who has committed to help along the process. If no appropriate mentored bugs are available, an older “good first bug” list could offer a useful starting point.

Once fixed the bug, the developer should submit her patch for review and finally have it checked in by someone with enough privileges.

Developing Apps for Firefox OS

If you'd rather not get your hands dirty with the lower-level OS components, you can develop an app running on Firefox OS. The basic tools for Firefox OS app development are the latest Firefox browser, Firebug, and the Firefox OS Simulator Addon.

More useful resources to know about are:

  • Boilerplate app: a basic template showing an app's structure and WebAPI usage;
  • IndexedDB: an API for client-side storage of significant amounts of structured data, whereas DOM Storage is suitable to store smaller amounts of data;
  • App Manifest: a manifest is one of the key things distinguishing an Open Web App from a website. It is a JSON file with a name and description for the app, and it can also contain the origin of the app, icons, and the permissions required by the app, among other things;
  • App Manager: a set of tools to manage local apps, devices, and development toolboxes (inspector, debugger, etc.);
  • Brick web components: a specification to support HTML5 reuse through components;
  • Firefox OS style guide: human interaction guideline describing all elements of appearance and UI behavior.

Mozilla Rep Shafiul Azam has also made available a presentation describing the basic steps to develop an app for Firefox OS.

Rate this Article