Skip to main content
← All Tools · 🛠️ Mobile

Apache Cordova — Legacy Hybrid Mobile Apps with HTML/CSS/JS

Apache Cordova builds hybrid mobile apps using HTML, CSS, and JavaScript in a native WebView with plugin access to device APIs across platforms.

Open Source Free and open source (Apache Software Foundation). No licensing fees.
mobilehybridjavascriptwebviewapachephonegaplegacy

✅ Pros

  • + Build mobile apps with standard HTML, CSS, and JavaScript — no new language required
  • + Plugin ecosystem for device APIs (Camera, GPS, Contacts, FileSystem)
  • + Targets iOS and Android from a single web codebase
  • + Simple mental model for web developers
  • + Battle-tested over 15+ years in production

⚠️ Cons

  • − WebView-based rendering — not truly native, performance ceiling
  • − Largely superseded by Capacitor (the modern replacement)
  • − Plugin maintenance is inconsistent — many plugins are unmaintained
  • − No hot reload or fast refresh during development
  • − Cordova is effectively in maintenance mode — limited new development

What is Apache Cordova?

Apache Cordova (originally created by Nitobi, then acquired by Adobe as PhoneGap, then open-sourced to Apache) is a hybrid mobile app framework that wraps web applications in a native WebView. Released in 2009, Cordova was the original solution for “write once in web, run on mobile” development — predating React Native (2015), Flutter (2018), and Capacitor (2019) by years.

A Cordova app is essentially a website running inside a full-screen, chrome-free native browser on your phone. Cordova’s JavaScript plugin API provides access to device capabilities that a regular browser can’t reach: camera, contacts, GPS, accelerometer, file system, push notifications, and more.

Cordova Architecture

+------------------+
|   Your Web App   |  ← HTML/CSS/JavaScript
|  (HTML/CSS/JS)   |
+------------------+
        |
+------------------+
|  Cordova Bridge  |  ← JavaScript → Native plugin call
+------------------+
        |
+------------------+
|  Native Plugins  |  ← Swift/ObjC (iOS), Java/Kotlin (Android)
+------------------+
        |
+------------------+
| Native WebView   |  ← WKWebView (iOS), WebView (Android)
+------------------+

The WebView loads your index.html, and the Cordova JavaScript library (cordova.js) sets up the plugin bridge. When you call navigator.camera.getPicture(), Cordova serializes that call, passes it to the native layer, the native plugin executes, and the result comes back to your JavaScript callback.

Core Plugins

The standard Cordova plugin set covers the most common device APIs:

PluginNPM PackageFunctionality
Cameracordova-plugin-cameraPhoto capture and library access
Geolocationcordova-plugin-geolocationGPS positioning
Filecordova-plugin-fileFilesystem read/write
Networkcordova-plugin-network-informationConnection type detection
Batterycordova-plugin-battery-statusBattery level/status
Devicecordova-plugin-deviceDevice info (model, platform, UUID)
Dialogscordova-plugin-dialogsNative alert/confirm/prompt
Vibrationcordova-plugin-vibrationHaptic feedback
// Example: Camera plugin
navigator.camera.getPicture(
    (imageData) => {
        const img = document.getElementById('photo');
        img.src = 'data:image/jpeg;base64,' + imageData;
    },
    (error) => { console.error('Camera error:', error); },
    {
        quality: 80,
        destinationType: Camera.DestinationType.DATA_URL,
        sourceType: Camera.PictureSourceType.CAMERA
    }
);

Project Structure

my-cordova-app/
├── config.xml          # App configuration (id, name, plugins, permissions)
├── www/                # Your web application (HTML/CSS/JS)
│   ├── index.html
│   ├── css/
│   ├── js/
│   └── img/
├── platforms/          # Generated native projects (don't edit directly)
│   ├── ios/
│   └── android/
└── plugins/            # Installed Cordova plugins

The www/ folder is your web app. Cordova builds it into native projects in platforms/.

Basic Usage

# Install Cordova CLI
npm install -g cordova

# Create project
cordova create myApp com.example.myapp "My App"
cd myApp

# Add platforms
cordova platform add ios
cordova platform add android

# Add plugins
cordova plugin add cordova-plugin-camera
cordova plugin add cordova-plugin-geolocation

# Build and run
cordova run ios
cordova run android

# Build for release
cordova build ios --release
cordova build android --release

Migrating from Cordova to Capacitor

Since Capacitor was designed as Cordova’s successor by the Ionic team, migration is structured:

# In your existing Cordova project
npm install @capacitor/core @capacitor/cli
npx cap init [appName] [appId]

# Migrate platforms
npx cap add ios
npx cap add android

# Replace Cordova plugins with Capacitor equivalents
# cordova-plugin-camera → @capacitor/camera
# cordova-plugin-geolocation → @capacitor/geolocation
# cordova-plugin-push → @capacitor/push-notifications

Most official Cordova plugins have direct Capacitor equivalents with a similar API surface. The migration usually takes a few days for a medium-sized app.

Cordova vs Capacitor

FeatureCordovaCapacitor
Maintenance statusMaintenance modeActively developed
Native project ownershipAuto-managedYou own ios/ and android/
Plugin installationcordova plugin addnpm install + cap sync
TypeScript supportAdded laterFirst-class
PWA supportNoYes
Modern toolingDatedModern (Vite, etc.)
Hot reloadNoYes (with Ionic CLI)
Framework preferenceFramework-agnosticFramework-agnostic

When Cordova Still Makes Sense

Despite being in maintenance mode, Cordova remains relevant in specific scenarios:

  1. Legacy apps: Existing Cordova apps in production that work fine and don’t need new native features — no migration pressure.

  2. Specialized plugins: A few niche Cordova plugins have no Capacitor equivalent. If you need one of them, Cordova (or writing a custom Capacitor plugin) may be the only option.

  3. Enterprise tooling: Some enterprise MDM (Mobile Device Management) systems and corporate build pipelines are still built around Cordova workflows.

  4. Team familiarity: Teams with deep Cordova expertise maintaining existing apps may find migration cost higher than value for stable, maintained apps.

For any new hybrid mobile project started in 2026, Capacitor is the correct choice. The architecture is modern, the tooling is better, and the Ionic team is actively investing in it. Cordova’s 15-year legacy is impressive, but its time as the default choice for new projects has passed.