After Adobe ended its support for Cordova in 2020, many companies using the framework for their mobile applications were left unsure how to proceed. Although the project is still being maintained by its community, losing its enterprise sponsor has undoubtedly slowed its progress.
Luckily, Capacitor has established itself as a viable alternative to Cordova. It was developed by Ionic, who also created the UI framework of the same name. Ionic’s team used its experience working with Cordova to improve upon it in several ways.
But before we dive into the technical details, let’s clarify some terms to avoid confusion.
PhoneGap, Cordova, Ionic, Capacitor: How do they all relate?
PhoneGap was a framework for developing mobile applications using web technology. It was created by Nitobi Software in 2009. When Adobe acquired the company in 2011, it donated PhoneGap’s source code to the Apache Software Foundation. The result was Cordova, an open-source version of the core framework. PhoneGap and Cordova existed side by side until Adobe announced the end of PhoneGap and its support for Cordova in 2020.
Unlike the proprietary PhoneGap, Cordova continues to be maintained primarily by its open-source community. It allows developers to create a web application, wrap it in a sandbox browser to run it on various platforms, and give it access to native features like the camera or accelerometer via plugins. It eliminates the need to maintain several projects for different operating systems. Instead, the same code can be used as the basis for each app.
Ionic is a mobile app development framework released in 2013 by the company of the same name. It uses web technologies like HTML5 and CSS3 to enable cross-platform development and provides a library of UI components for creating native-like user interfaces. Ionic initially used Cordova as its app runtime, but then replaced it with its own solution, called Capacitor.
With Capacitor, Ionic built on their experience with the Cordova runtime to offer an improved alternative. Web applications created with the Ionic framework can be wrapped with Capacitor to run on other operating systems, including Android, iOS, and Windows.
Advantages of Capacitor over Cordova
Since Ionic created Capacitor as a successor to Cordova, it offers several advantages that make switching from one framework to the other attractive:
- Native API access without plugins: Whereas Cordova relies on plugins to access a device’s native APIs, Capacitor lets developers use them directly. For example, accessing a device’s camera uses the same code on Android, iOS, and Windows.
- Out-of-the-box PWA support: Capacitor offers pre-configured UI elements for web APIs to make creating a progressive web app simple. Giving users the option to install an app right from their browsers adds an additional distribution channel.
- Backward compatibility to Cordova: When moving an app from Cordova to Capacitor, developers can count on most plugins being compatible with Capacitor. In addition, Ionic offers many alternatives specifically for Capacitor, which means they are maintained by them and receive regular updates.
- Enterprise backing: Since Adobe no longer supports Cordova, developers need to rely on the open-source community in case of issues with the framework. Capacitor, on the other hand, is backed by Ionic as well as its community of open-source contributors.
Should Cordova users switch to Capacitor?
Moving a mobile app from one framework to another is not trivial, so you might be wondering if using Capacitor instead of Cordova is worth the effort.
The answer depends on how much support you will need in the future.
Capacitor has the backing of Ionic, whose own cross-platform framework depends on it. The company regularly provides users with software updates and new plugins. Meanwhile, it also ensures backward compatibility with Cordova.
In addition, they offer an enterprise tier for extended support, which will come in handy should you ever need to include specific features for your application.
Since Capacitor is backward compatible with most Cordova plugins, chances are you can keep a good part of your code as it is. While it’s recommended to switch to Ionic’s more frequently updated equivalents, migrating critical plugins one after another is a viable option.
If you want to switch to Capacitor in the future, now is a good time to familiarize yourself with the framework. The Ionic team has created helpful guides to get you started.
The Scanbot SDK for Cordova and Ionic Capacitor
Our Barcode Scanner SDK, Document Scanner SDK, and Data Capture SDK are available as Cordova plugins that are also compatible with Ionic Capacitor. You can find an example project in our GitHub repository.
We’re also developing additional SDKs for Capacitor specifically. To make full use of the capabilities provided by Ionic’s framework, these will not be backward compatible with Cordova. Keep an eye on our blog for further updates!