| name | cordova |
| description | Apache Cordova hybrid mobile framework. Use for hybrid apps. |
Cordova
Apache Cordova (formerly PhoneGap) wraps HTML/CSS/JS apps in a native WebView container. While largely superseded by Capacitor and React Native, it remains active (CLI 13.x) for specific legacy use cases.
When to Use
- Maintaining long-standing legacy hybrid applications.
- Need an extremely thin wrapper around a pure web app with minimal native plugin interaction.
- Recommendation: New projects should use Capacitor (which is backward compatible with many Cordova plugins).
Quick Start
npm install -g cordova
cordova create hello com.example.hello HelloWorld
cd hello
cordova platform add android
cordova platform add ios
cordova run android
Core Concepts
Deviceready Event
The most critical event. You cannot call any native plugins until this fires.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log("Running cordova-" + cordova.platformId);
}
config.xml
The central configuration file for build settings, permissions, and plugin declarations.
Plugins
Interfaces to native code.
cordova-plugin-camera, , etc.