Cordova helps us to make the mobile development more user friendly and easy. Due to the demand of mobile applications we saw that most of the companies are having their own Mobile Application weather its useful or not.
Cordova helps us to create Mobile Application development using Javascript/HTML. Cordova allows you to easily write one set of code to target nearly every phone or tablet on the market today and publish to their app stores. Here in this tutorial i will show you some commands which will help you to create a project and build the APK of your project.
I have used some of the tools for working which i am writing here.
- JDK
- Android SDK
- Set Environment Variable
- Set Emulator
- Netbeans for my code part
- Node Js CLI for running the Cordova Commands
Lets start the Command part.
Open Node JS CLI for running the commands. Navigate to the folder where you want to the create the project folder.
For creating the project folder we will write
cordova Create FolderName com.example.example ProjectName
Now navigate to the project folder.
cd ProjectName
Now we will add the platform in this tutorial i am adding the Android Platform.
cordova platforms add android
cordova platforms add android @ 5.0.0
These both the code add the android platform just a small difference. When you need a specific android platform just use the 2nd line else first one also works for you.
If you want to check added platforms than write this command.
cordova platforms ls
Now we have created the project folder and added the platforms. If we want to add any plugin than we will write. ex – we will add a toast plugin
cordova plugin add cordova-plugin-x-toast
If you want to remove the plugin.
cordova plugin remove cordova-plugin-x-toast
If you want to see the list of plugins which you are using in your project than write
cordova plugin list
After the project finishes we need an APK to test it over our cell phone. So for creating the Build we will write
cordova Build or cordova build android
After the build if you want to run the application over you pc than you have to write.
cordova emulate android
emulate command will work if you earlier setup the Emulator.
Thats all friends in this tutorial you will see some commands to create the Cordova Project and Build it for your mobile device.
In the next part we will show you how you can create the Signed APP for Google Play Store.
No Comments