How to Setup Phonegap/Cordova
August 13, 2018
Keyur Patel
2 min
- Cordova is an open-source mobile development framework. It enables you to utilize standard web innovations, for example, HTML5, CSS3, and JavaScript for cross-stage advancement maintaining a strategic distance from every portable stages’ local improvement dialect. An engineer can broaden an application crosswise over in excess of one stage, without having to re-execute it with every stage’s dialect and device set by utilizing Cordova.
- To install Cordova, the node must be there in your local machine.
- To install Cordova, you need to run this command: npm install –g Cordova
- Now next step is to create blank Cordova project to your local directory.
- To create the blank project you need to run this command: cordova create <path>
- It will create the blank project for you and the next step is to add platforms into it.
- Cordova application only contains client-side code, there is no server-side code that means javascript is used while developing the application.
- Next step is to add platforms into the project, to test application in the browser you must add web platform: Cordova platform add browser
- Cordova provides different platforms to allow it run into different devices like android, ios, WebOS, blackberry.
- Let’s assume we are adding android and ios platforms into the project, then you must set basic configuration into XML files like android and ios tag must be there in the config file.
- Cordova most important part is plugins
- If you want the user to allow to access native functionality access, you must install the plugin and its configuration.
- You can install the plugin by this command: cordova plugin add <plugin name>@version (default latest)
- To remove any plugin use this command: cordova plugin rm <plugin name>