Saktanong - stock.adobe.com
Ionic's Capacitor is emerging as a key tool for web developers to build native iOS and Android apps using the web tools, libraries and frameworks they already know.
However, the big difference is that Ionic Capacitor is a "generational" step forward, and makes use of Web APIs, native tools, and other modern dev standards that simply didn't exist when Cordova was first introduced, said Max Lynch, CEO and co-founder of Ionic in Madison, Wisconsin.
Capacitor apps offer tighter native integration -- including direct access to SDKs and device APIs, along with greater performance and support for Progressive Web Apps (PWA) using the latest Web APIs to access native device features.
"I've worked on several cross-platform applications over the years and hybrid applications are usually my go-to solution," said Guy Nesher, a developer for Chicago-based Locusview in Herzliya, Israel. "Until recently, Cordova was the main library used for developing hybrid applications -- however, the limited ongoing support and development was causing a lot of issues. In fact, if I had to guess, this was probably the reason Ionic decided to develop Capacitor."
Capacitor offered a modern approach to hybrid applications, and came bundled with many of the native capabilities he generally uses and offered better integration with PWAs, Nesher said. It also had backward compatibility with third-party plugins that were written for Cordova, he said.
"I waited a while before making the jump just to make sure it was stable enough for production, but that happened rather quickly," Nesher added.
However, like Nesher, "Sworkit developers continually struggled with Cordova as more team members tried to work on the same project," said Cory McArthur, a user experience engineer at Sworkit. "We spent quite a bit of time getting the build to work before we could get development work done," he said. "This is primarily because Cordova considers each platform a build time asset -- meaning you don't typically commit the build to Git."
On the other hand, Capacitor considers each platform a source asset instead of a build time asset. That means developers can commit any native code they write.
Another feature that drew Sworkit to Capacitor was its cross-platform support, McArthur said. For example, if a developer wants to apply a photo, they can simply call one function within Capacitor, and it will work on websites, iOS and Android. Cordova did not provide any support for web development, so developers would have had to write that themselves, and add logic to determine when to call that code.
An eye on flexibility
Capacitor was originally introduced to the Ionic community as the core of the Ionic stack but has since gained traction in the broader web community. You can use Capacitor with Tailwind, React Material UI, Angular, React, Vue and any other web library or framework. And unlike alternatives such as React Native or Flutter, developers build with standard web tools. There is no proprietary layer or special languages like Dart that a developer would have to learn.
Guy NesherSoftware developer, Locusview
As a result, Capacitor's adoption stats are growing quickly, with 400,000 monthly downloads. Capacitor is particularly appealing to large enterprises like Restaurant Brands International -- parent company of Burger King, Tim Hortons and Popeye's -- who already have their own custom web UI libraries and would prefer to bring those to mobile rather than build from scratch with the native UI components offered on iOS and Android. The Burger King app is an example of Capacitor in the wild.
Enterprises are prioritizing mobile development and they want assurances from a vendor that the Ionic enterprise packages offer, such as customer support, enterprise support SLAs and premium add-on solutions for biometrics, authentication and mobile DevOps.
"I'm mostly using Capacitor at work where we built an enterprise application for the underground infrastructure industry," Nesher said. "It's a fairly large application that has deep integration with external Bluetooth devices -- GPS receivers, barcode scanners and more, and complex mapping use cases with thousands of locations that include complex data set."
Nesher also used Capacitor to develop a small application that enables users to share the locations of edible fruit trees inside cities, which has mostly been used in his local community.
Darryl K. Taft covers DevOps, software development tools and developer-related issues from his office in the Baltimore area. He has more than 25 years of experience in the business and is always looking for the next scoop.