How to use cordova cli to develop hybrid app
Today mobile devices are common to every hand starting from a student to a business man or from a car driver to a pilot of a aircraft. Day by day smart phone users are increasing as a result more and more web sites and apps are increasing in web hosting and app stores. Every business owner wants to go online to sell their product as a result demand of apps are increasing. We can hybrid app using cordova cli.
Since iOS and Android are the two most popular platforms in the mobile world, developers are taking interest to target them and this has actually forced them to create separate applications for different mobile devices.
PhoneGap is a mobile app development framework that is based upon the open source Apache Cordova project.
To develop the cordova cli based mobile app we need a development environment in our tutorial we are using command line environment preferably cmdr. Cmdr supports all command of windows and linux.
To download cmdr for cordova cli go to http://cmder.net/ download and install
Now to start installing essential components for apache cordova cli
The Cordova command-line tool is distributed as an npm package.
Download cordova command-line tools
- First download Node.js . After installation Node.js you will be able to run command node and npm
- You may download git client to run git from your command line
- Now install cordova using npm.The cordova will automatically downloaded my npm. Npm is a utility of Node.js on linux environment
The command for linux in cordova cli
sudo npm install -g cordova
The command for windows in cordova cli
npm install -g cordova
Start creating the App in cordova cli
Go to a folder where you want to create the app and start tying the following command
cordova create hello com.example.hello HelloWorld
To add platform
cordova platform add android
We may use browse platform also to thes the app in browser to add browser platform
cordova platform add androidTo build the app
find thebuild in platform ->android->build->outputs->apk folder