The Cordova community recently released version 3.5.0 of the tools. This version includes some exciting improvements to the Firefox OS development workflow. Before we dive into the new features, make sure you have the latest version by running:
$ sudo npm install -g cordova $ sudo npm install -g plugman
Now that we’re all set up, let’s dive into the new features.
Improved manifest management
In previous versions of Cordova, developers had to manually edit the
manifest.webapp file to add permissions and other app information. This file has crucial information that Firefox OS needs to interact with your app.
Cordova has a configuration file called
config.xml that already contains the same information needed for the manifest file. Cordova will create and update the manifest based on your
config.xml file. In the new version, plugins can add configuration specifying which permissions are necessary. Whenever you run a
cordova prepare, the manifest is updated based on your configuration. Now you can have all your app’s information in one place.
Building packages with Cordova
Firefox OS uses web technologies that do not require a compilation step to generate binaries. The related Cordova commands
compile were left unimplemented and would throw an exception when called. That behavior was confusing and left some people wondering what went wrong.
cordova build or
Cordova compile will create a zip of your packaged app in the
build folder inside the
platform/firefoxos folder. A big thank you to the contributor Gert-Jan Braas for implementing this!
A fresh batch of core plugins were released too. We added Firefox OS support to a few more plugins:
To update to the latest version of the plugins, you need to remove and add them again. For example, to use the latest version of the file plugin run:
$ cordova plugin rm org.apache.cordova.file $ cordova plugin add org.apache.cordova.file
Check our status page for updated information on plugin status.
A highly requested feature is support for
run Cordova commands. We are working with the Dev Tools team to create an awesome experience for debugging Cordova applications using Firefox’s App Manager. Here is a sneak preview of what’s coming!
Meanwhile you can debug your app by adding the
platforms/firefoxos/www folder to the app manager in Firefox. For more information, check out Cordova for Firefox OS on MDN.
We are working on creating default icons for a newly created app. They will serve as placeholders that can be easily replaced with your app’s brand.
We also have a development status page where you can see up to the minute information on what is being worked on.
We’d love to hear your feedback and feature requests. You can reach us in the #cordova channel on IRC, or through email at firstname.lastname@example.org or log your issues and requests on the Apache Cordova issue site. Also if you are interested in helping out with the project let us know.
About Jason Weathersby
Jason Weathersby is a Technical Evangelist for Mozilla, evangelizing Firefox OS. He is also a committer on the BIRT project at the Eclipse Foundation, and has co-authored several books on BIRT integration. He is a proponent of HTML5, Open Source and all things related to web-based gaming.
About Rodrigo Silveira
Works on Mozilla's cross-platform apps team improving Firefox OS support for Cordova and PhoneGap. Passionate about making the web an even better platform for developers. Loves snowboarding, BBQ and beer.