In this recipe, we will run through the steps to create a basic Cordova application.
Before getting started with Cordova, we must install the Cordova library. Cordova can be installed as a Node package.
Open a terminal window and install the Node package with the following code:
npm install -g cordova
This will install the Cordova package into Node's global space and allows us to use the Cordova command-line utilities to create and manage our mobile application.
Once Cordova has been installed, we can use the cordova
command-line tool to create a mobile application.
At a terminal window, perform the following steps:
Execute the
cordova create
command:cordova create HelloWorld com.csbook.helloworld
Switch to the
HelloWorld
directory:cd HelloWorld
Add a target platform using the
cordova platform add
command:cordova platform add android