Apache Cordova is an open-source mobile development framework that enables developers to create cross-platform applications using standard web technologies like HTML5, CSS3, and JavaScript. With Cordova, you can execute your application within a wrapper targeted to each platform, relying on standards-compliant API bindings to access device capabilities such as sensors, data, network status, and more.

Whether you're a mobile developer looking to extend an application across multiple platforms without re-implementing it for each platform's language and toolset, or a web developer seeking to deploy a web app packaged for distribution in various app store portals, Cordova is the perfect choice. You can also use Cordova if you want to develop a plugin interface between native and WebView components, or if you're interested in mixing native application components with a WebView that can access device-level APIs.

Architecture

A Cordova application consists of several key components, including the WebView, Web App, and Plugins. The following diagram provides a high-level overview of the Cordova application architecture:

The WebView provides the application's user interface, which can be a standalone component or part of a larger hybrid application that mixes native and WebView components. The Web App is where your application code resides, implemented as a web page with CSS, JavaScript, images, media files, and other resources necessary for it to run.

The config.xml file plays a crucial role in providing information about the app and specifying parameters affecting how it works, such as whether it responds to orientation shifts. Plugins are an integral part of the Cordova ecosystem, providing an interface for Cordova and native components to communicate with each other and bindings to standard device APIs. This enables you to invoke native code from JavaScript.

Development Paths

Cordova provides two basic workflows for creating a mobile app: the Cross-platform (CLI) workflow and the Platform-centered workflow. The cross-platform workflow is ideal for developers who want their app to run on as many different mobile operating systems as possible, with little need for platform-specific development. This workflow centers around the cordova CLI, which provides a high-level tool that allows you to build projects for multiple platforms at once.

The platform-centered workflow is best suited for developers who want to focus on building an app for a single platform and need greater control over the project within the SDK. This workflow relies on a set of lower-level shell scripts tailored for each supported platform, as well as a separate Plugman utility that allows you to apply plugins.

When first starting out, it may be easiest to use the cross-platform workflow to create an app, as described in Create your first app guide. You then have the option to switch to a platform-centered workflow if you need the greater control the SDK provides.

Installing Cordova

The installation of Cordova will differ depending on the workflow you choose:

  • Cross-platform workflow: See Create your first app guide.
  • Platform-centered workflow.

After installing Cordova, it is recommended that you review the documentation and guides provided to ensure a smooth development process. With Cordova, you can create cross-platform applications that run seamlessly across multiple platforms, giving you the flexibility and control you need to bring your mobile app ideas to life.