What is apache cordova?
The History of Cordova
From a traditional stance, an app developer would be required to have specific skills for a specific platform. For example, in order to develop an app for Android, one would be required to learn Java and need to follow the rules and frameworks specific to Android development. Likewise, in order to develop an app for iOS, one will need to learn a different programming language like Swift or Objective C and hence, follow the rules and framework specific for iOS development. As such, it can be a pain to maintain and rewrite the codes for each platform since they use different frameworks. In order to bridge this gap, frameworks like Apache Cordova have been introduced. It was originally developed by Nitobe in 2009 but later sold to Adobe Systems in 2011.
Moreover, hybrid apps can access certain capabilities of native devices with the use of plugins thereby delivering a native experience for the users. Important features of a native device such as a camera, media storage, accelerometer, contacts, geolocation, compass, etc. can be accessed by the hybrid app. The API provided by Cordova Framework also allows developers to easily create custom plugins based on their needs.
The Command Line Interface (CLI) can be used to efficiently develop, test and deploy the HYBRID mobile application across different platforms more easily. Developers can also run specific commands to test the app on different mobile devices – real devices as well as emulated. However, the SDK tools for each targeted mobile platform must be installed before utilizing the CLI tools.
Another perk of using Cordova is that it also has app templates that have been already coded and are readily available for use. This can help save time and allow developers to create their projects more quickly.
There are also a couple of well-known organizations that have used Apache Cordova to develop cross-platform mobile solutions. Facebook and Salesforce, for instance, use a forked version of Apache Cordova in their SDK. Other organizations like IBM, Adobe and Microsoft are also using this. The Cordova community is constantly growing with a lot of helpful and supportive people. With such a community, it is easy to get assistance and help even if you get stuck.
Cordova applications rely on a common
config.xml file that provides information about the app and specifies parameters affecting how it works, such as whether it responds to orientation shifts. This file adheres to the W3C’s or widget, specification.
cordova.js file, which provides API bindings.
The Cordova-enabled WebView may provide the application with its entire user interface. It can also be a component within a larger, hybrid application that mixes the WebView with native application components. Cordova provides a plugin interface for these components to communicate with each other.
The easiest way to set up an application is to run the
cordova command-line utility, also known as the command-line interface (CLI). (To install the CLI, Depending on the set of platforms you wish to target, you can rely on the CLI for progressively greater shares of the development cycle:
- In the most basic scenario, you can use the CLI simply to create a new project that is populated with default configuration for you to modify.
- For many mobile platforms, you can also use the CLI to set up additional project files required to compile within each SDK. For this to work, you must install each targeted platform’s SDK. As indicated in the Platform Support table below, you may need to run the CLI on different operating systems depending on the targeted platform.
- For supporting platforms, the CLI can compile executible applications and run them in an SDK-based device emulator. For comprehensive testing, you can also generate application files and install them directly on a device.
At any point in the development cycle, you can also rely on platform-specific SDK tools, which may provide a richer set of options. An SDK environment is more appropriate if you want implement a hybrid app that mixes web-based and native application components.
You may use the command-line utility to initially generate the app, or iteratively thereafter to feed updated code to SDK tools. You may also build the app’s configuration file yourself.
Command Line Interface (Cordova CLI) This tool can be used for starting projects, building processes for different platforms, installing plugins and lot of other useful things that make the development process easier. …
What is Apache Cordova used for?
What is Apache Cordova? | Pros and Cons of Apache Cordova | GB
Pros of Apache Cordova
- Cordova offers a single platform that can be used to create cross-platform mobile applications. As such, you don’t have to worry about learning different programming languages for each platform.
- Saves time as hybrid apps take lesser time to develop as compared to developing an app for each native platform separately.
- Easier to maintain as it bypasses version making it simple to update. With native apps, developers need to deliver a new version for each update and users need to update the app for each new version release.
- Cost-effective as you don’t have to spend resources on different platforms. Instead, you can use a single code base to create an app for multiple platforms.
Cons of Apache Cordova
- Because of its cross-compilation capabilities, hybrid apps tend to be slower.
- There may be compatibility issues for some plugins across different platforms and devices.
- Plugins may not function properly so it may need to be forked and modified.