What is Apache Cordova?

In the past years, making a native mobile app was all about being good in the mother tongue of the operating system that you created an app with. This means Objective C for iOS, Java for Android and C# for Windows Phone.

Welcome to the 21st century, where you can write javascript to create not only web pages, but also mobile applications.

With the help of Apache Cordova, a game-changer open-source framework, you can target multiple platforms with a codebase. All you need to learn is the normal HTML, CSS and JavaScript used for web development, and by reading some Cordova documents, you must already be a mobile developer.

The beauty of Cordova is that it allows developers to develop web development skills to create mobile applications on several different platforms. Using standard HTML, CSS and JavaScript, a single code base can become apps for Apple, Android and Windows phones.

Cordova also has a wide variety of plugins that allow interacting with the device’s native functions via JavaScript. With Cordova plugins, we can allow our app to easily interact with the camera, GPS, push notifications and many other functions.

Hello Cordova

Cordova application creation requires Nodejs and their CLI. Cordova CLI is a command-line interface that simplifies the process of creating new Cordova applications on the system of your choice. After installing Nodejs, open terminal to use the node package manager.

npm install -g cordova

After installing Cordova CLI through NPM, you can use it to create your first application.

cordova create hello com.example.hello HelloWorld

Congrats on your first mobile app, “www” folder is your new workplace. After the development process with web technologies, you can run the following commands to prepare your app for various platforms.

cordova platform add android
cordova prepare android
cordova platform add ios
cordova prepare ios

Cordova wraps the whole project in a platform specific project output and and sets up everything in a way that will run ‘www/index.html’ on app launch.

Output projects under ‘platforms’ folder needs to be compiled separately according to platform specifics. After completion, they are ready to be shipped to app stores!

This is just a brief explanation of the process. I recommend you spend some time looking at what the Cordova has to offer, looking at the available documentation.