Book Image

PhoneGap Beginners Guide (third edition)

Book Image

PhoneGap Beginners Guide (third edition)

Overview of this book

Table of Contents (22 chapters)
PhoneGap Beginner's Guide Third Edition
About the Authors
About the Reviewers
Related Plugin Resources

PhoneGap and Apache Cordova

PhoneGap was originally developed by Nitobi and the company was later acquired by Adobe in 2011. After it was acquired, Adobe donated the PhoneGap code base to the Apache Software Foundation (ASF) under the project name Cordova, which is the name of the street in Vancouver where Nitobi's offices were located and where the company created the first version of PhoneGap.

One of the biggest advantages of moving the code base to the ASF is that anyone can easily contribute to the project. Many companies are not only comfortable with the Apache-flavored licenses but already have a Contributor License Agreement with Apache. For developers who are interested in contributing to a vibrant open source project, Apache Cordova is a great opportunity.

PhoneGap is a free and open licensed distribution of Apache Cordova. Picture Cordova as the engine on which PhoneGap and its related services (debug, emulate, and build services) are built. Adobe provides an integrated platform to build applications for multiple platforms with a single click. If you don't want to use Adobe's build features, you have to manually build applications for each mobile platform. Apart from these, for both PhoneGap and Cordova developers, nothing has changed.

Adobe continues to play a major role in the project, investing in its ongoing development, and the company decided to keep the PhoneGap name to describe its own distribution of the Cordova project. Other contributors to the Apache Cordova project include Google, RIM, Microsoft, IBM, Nokia, Intel, and Hewlett-Packard. For more details about Cordova and PhoneGap, refer to the following online resources. They have several useful bits of information and tutorials for a beginner to start with development:


We will be using the terms PhoneGap and Cordova throughout this book and technically both are the same. You can replace Cordova and PhoneGap with each other.

The evolution of PhoneGap and Cordova

PhoneGap has evolved very quickly since January 2012, with multiple releases every year. Apache Cordova uses Semantic Versioning specification (more information is available at It's a very good practice that tells developers whether a release has major or minor improvements.

Since the 1.4 release, the project has been known as Apache Cordova. This release is generally considered the first stable release of the framework, with a fairly complete and up-to-date documentation. The 1.5 release fixed a long list of bugs, but the initial reaction of the community was not very favorable because the documentation was outdated and some changes to the main files caused broken build issues to apps developed with earlier releases.

The 1.6 release brought some improvements to the plugin architecture, the Camera and Compass APIs, and the project template files. As is often the case with a maturing community, the release was not perfect but there was a significant improvement in the overall quality compared to the previous release. The 1.7 and 1.8 releases were bug fixes and added support for Bada 2.0. The community reaction was also positive because of the speed of the releases. The 1.9 release addressed even more bug fixes and added support for the new features of the iOS and Android platforms.

Apache Cordova 2.x added the following features and support:

  • The definition of a unique JavaScript file to use across all platforms thanks to the unification of the JavaScript layer of the Cordova application framework

  • The introduction of a command-line tool (CLI) through which common operations, such as project creation, debug, and emulation, could be performed in a standard way (Android, iOS, and BlackBerry)

  • The capability to embed PhoneGap applications into larger native iOS and Android applications using Cordova WebView

  • Support for the Windows phone platform

  • The porting of the Web Inspector Remote (Weinre) to Node.js and the introduction of a node module that facilitates installation using Node package manager (npm)

  • Improved plugin documentation

  • Several improvements to the process of creating iOS apps

  • The standardization of the commands available for each platform (that is, build, run, and so on)

With the 2.x release, Apache Cordova and PhoneGap has become a mature, stable, and powerful tool in the mobile developer's toolkit.

Since the introduction of version 3.0 in September 2013, PhoneGap has used a new plugin architecture to keep the application core small and fast performing. Plugins can be installed and uninstalled using the updated Cordova command line interface (CLI). PhoneGap 3.0 also introduced several new command-line tools; for instance, users can now install PhoneGap easily using npm without downloading ZIP files. Two new APIs, namely InAppBrowser (earlier known as ChildBrowser) and Globalization API were also released with the PhoneGap 3.0 release. They also started discussions about dropping support for webOS, Symbian, Blackberry (BB7 and earlier versions), and Windows Phone 7.

With PhoneGap 3.1.0, basic support for FirefoxOS and Windows 8 were provided along with other bug fixes and platform enhancements. PhoneGap 3.2.0, released in November 2013, was focused on stability and several bug fixes. In December 2013, PhoneGap 3.3.0 was released with support for Android KitKat (v4.4).

With the release of PhoneGap 3.4.0, advanced support for FirefoxOS was added. PhoneGap 3.5.0 is the last version supporting Windows 7. With PhoneGap 3.6.3, commands supported by Cordova were added. There are several new features deployed to PhoneGap with every new release. At the time of authoring this book, we have PhoneGap 5.1.1, which provides advanced support for the PhoneGap Desktop App and Mobile App.