Home > Articles

Which to Use: Cordova or PhoneGap?

  • Print
  • + Share This
John M. Wargo, author of Apache Cordova 4 Programming, explains how two software products with similar names are now in many ways quite different, but both are essential and widely used in app development.
From the author of

For many years, PhoneGap and Apache Cordova have been the leading framework for building cross-platform mobile applications using HTML. Yes, framework, singular. From a core capabilities standpoint, Adobe PhoneGap and Apache Cordova are the same framework. Yep, absolutely the same.

In my day job as an analyst, I regularly talk with clients and vendors about cross-platform mobile development, and Cordova is a frequent topic of discussion. People regularly refer to the framework as PhoneGap. I'm not confused, because I've been a contributor to Apache Cordova and written books on both PhoneGap and Cordova. But I think the market is confused about the difference.

Are PhoneGap and Cordova the same thing? Yes, they are, more or less. Are they different? Yes, they certainly are.

Confused? Read on.

How PhoneGap Became Apache Cordova and Adobe PhoneGap

Let's start with the short version:

  • Apache Cordova is the current name for the open source project formerly known as PhoneGap.
  • Adobe PhoneGap is Adobe's distribution (flavor) of Apache Cordova, with some extra capabilities added by Adobe.

Here's what happened. In 2011, Adobe acquired Nitobi, the company that created and managed the open source PhoneGap project. PhoneGap was already used by several vendors in their software products. Also, since PhoneGap provided an easy way to deliver cross-platform mobile apps, a capability that was highly valued by development organizations, product companies (IBM, for example) and even some hardware vendors and mobile OS vendors (such as Google) were involved in the project. To protect stewardship and to help ensure the longevity of the PhoneGap project, Nitobi donated PhoneGap to the Apache Software Foundation immediately before closing the acquisition with Adobe. This action placed the project in a protected space, enabled invested parties to remain involved, and actually helped to make the project more visible in the community.

The PhoneGap project had a bit of a schizophrenic beginning at Apache. When the project was first donated, the team gave it a new name: Apache Callback. That name wasn't too popular, and it was quickly renamed Apache DeviceReady (because the PhoneGap capabilities were available in a PhoneGap app after the deviceready event fired). That name also failed, and the project finally stabilized under the name Apache Cordova, deriving its name from the street where the Nitobi offices were located when PhoneGap was created.

With a new name and now safely ensconced within the Apache Software Foundation, the project was ready to soar. At this point (around the time of release 1.4), Apache Cordova was simply the new name for PhoneGap; the two were essentially synonymous. Once Nitobi settled within Adobe, however, the team created a distribution of Apache Cordova and called it Adobe PhoneGap. Figure 1 illustrates how this process started and what it looks like today, as each version of Apache Cordova becomes a distribution of Adobe PhoneGap.

Figure 1 PhoneGap became Apache Cordova and Adobe PhoneGap.

After the initial release of Apache Cordova, the Cordova team started implementing new tools to simplify the process of creating and maintaining a Cordova application project. With early versions of PhoneGap (versions 1 through 2.x), creating projects for different mobile operating systems required different processes and tools for each. Beginning with Cordova 3, a unifying set of tools was added (the Cordova command-line interface) and a consistent project folder was implemented. It was suddenly much, much easier to work with Cordova application projects.

The former Nitobi team, now part of Adobe, stayed involved in the project and helped shepherd new features and capabilities. They also started thinking about how Adobe could enhance Cordova. With an open source project, the team could implement many improvements, but some changes would have been difficult or expensive to deliver. The Adobe team also came up with some interesting enhancements that really didn't belong in the Cordova project, either because they'd be difficult to maintain with existing Cordova team members or because they had commercial requirements that an open source project simply couldn't tackle. These enhancements (the "extra stuff" boxed in Figure 1) became additional capabilities delivered by Adobe's distribution of Apache Cordova, now officially called Adobe PhoneGap.

Still puzzled? Think of it this way: If we're discussing Linux distributions and I mention Debian, we've moved from a conversation about an open source operating system (Linux) to talking about a specific distribution of Linux, in this case the Debian distribution. If I say I'm using Linux, I could mean Debian—or any of a number of other Linux distributions. But if I say I'm using Debian, I mean that I'm using the Debian distribution of Linux.

When people mention using PhoneGap, they're probably referring to Cordova, but they might mean Adobe's distribution of Cordova instead. So they could be using Cordova and calling it by the wrong name, or using PhoneGap and one or more of the additional parts that Adobe provides in its distribution of the framework (the "extra stuff" in Figure 1).

Though the name changes happened years ago, people are surprisingly still confused about the difference between PhoneGap (Adobe) and Cordova (Apache). Here's an example of the confusion: My book PhoneGap Essentials: Building Cross-Platform Mobile Apps is still the bestselling book on PhoneGap, even though it was published in 2012 and covers a version of PhoneGap that is no longer available (and differs dramatically from the current version). Why are people still buying the book? Because the project is more widely known as PhoneGap than as Cordova. Though more books are available for Cordova than for PhoneGap, the older PhoneGap books still sell—even though they're too old to be useful anymore. Amazon and other vendors don't automatically make the connection between PhoneGap and Cordova, so customers are misdirected to older books when PhoneGap is used as a search term.

Meanwhile, Apache Cordova is now included in many commercial software products. Oracle, Salesforce, and many other companies use Cordova in their mobile development platforms. IBM MobileFirst (formerly known as IBM Worklight) includes a distribution of Cordova. IBM also contributes to the Cordova project, staffing the project with many developers.

PhoneGap Capabilities

Now that we've seen how Cordova and PhoneGap are the same, let's look at how they're different. The following sections describe the specific capabilities that distinguish the Adobe PhoneGap distribution of Apache Cordova.

PhoneGap Build Service

Cordova essentially allows web developers to build mobile apps. Their web applications run in a native application container that gives the web app access to native APIs, enabling the app to be distributed by app stores. Unless you're an experienced mobile developer, configuring a development environment for Apache Cordova (or Adobe PhoneGap) is the biggest initial hurdle you'll face. Web developers have their own tools, and many developers are familiar with build processes, but native mobile development—the core of what Cordova uses—demands different tools and skills, and in some cases specific hardware.

To help non-native mobile developers deliver Cordova applications, Adobe created the PhoneGap Build service. This commercial service (free options are also available) provides a cloud-based environment for packaging a web application into the Cordova runtime environment (container). Since this is the PhoneGap Build service, the app is actually packaged into the PhoneGap container, but it's pretty much the same as the Cordova container.

To use the service, developers package an app's web application resources (HTML, CSS, JavaScript, and other resource files) into an archive and then upload the archive to the build service. The build service executes the native compilation step that creates native PhoneGap applications for each selected target platform.

The reason this service is important is that some target platforms' specific environment requirements make it difficult for developers to set up the necessary environment they need to perform this process themselves. Android apps can be compiled (built) on Linux, OS X, and Windows, but iOS apps can only be built using an OS X system, and Windows apps must be built on a Windows system. The PhoneGap Build service eliminates the need to maintain different systems for the various build processes. Developers can code on their laptops using their standard web development tools, and then use the PhoneGap Build service for all compilation steps.

It would have been nearly impossible to provide these capabilities through the Cordova project's distributed team of independent developers. Delivering the service required the setup and maintenance of a cloud infrastructure that included Windows, OS X, and possibly even Linux systems for build use. Sharing the cost of setting up and maintaining the service would require maintaining a reliable billing system—something that would have been difficult for the team to deliver. Most importantly, someone would have to provide the initial capital to cover the cost of the service as it ramped up to profitability.

PhoneGap Developer App

To help simplify the process of testing and debugging PhoneGap applications, the Adobe team created the free PhoneGap Developer app. Building PhoneGap applications, especially through the shared infrastructure of the PhoneGap Build service, is a time-consuming process, requiring several minutes (or more) for each build on each target platform. As a developer updates an app, much time is spent waiting for the build process to complete before the new version of the app can be deployed to an emulator, simulator, or physical device. As developers repeatedly create new versions of the app, this time delay adds up, killing productivity.

To solve this problem, the PhoneGap Developer app streamlines the build process by providing a pre-built app that developers can use to test their apps. The developer installs the PhoneGap Developer app on one or more test devices and then uses command-line tools provided by Adobe to deploy the updated web application content to the pre-built application. Whenever the developer saves a new version of the app, the updated content instantaneously appears in the developer app for use. What previously could take minutes now takes only seconds, dramatically increasing developer productivity.

Adobe could have implemented this feature through the Cordova project, but the solution would have been more complicated, as Cordova would have had to distribute the source for the app and then developers would have had to build and deploy their own versions of the app. To make this process as seamless as possible, the app needs to be available to anyone through device app stores—something that only an established mobile app publisher like Adobe could manage easily.

Adobe PhoneGap Enterprise

Next for Adobe came integration of Cordova into existing Adobe products through the Adobe PhoneGap Enterprise offering. Basically PhoneGap Enterprise bundles a custom PhoneGap application with some additional services for content delivery, notification, management, and more, via the Adobe Marketing Cloud. These capabilities are exposed in mobile applications either by using the bespoke PhoneGap Enterprise app or by bundling PhoneGap capabilities into custom native applications. (The Adobe Marketing Cloud already supports browser-based access to content.)

Conclusion

There you have it—the whole PhoneGap story. You now know when to say "Apache Cordova" versus "Adobe PhoneGap." Don't get them wrong and confuse people. (Oh, and point people to my Cordova books, will you? Not the outdated PhoneGap book. Thanks!)

  • + Share This
  • 🔖 Save To Your Account