TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

Creating First Cordova Application

Creating First Cordova Application with Introduction, Installation, Architecture, PhoneGap, Creating First Cordova Application, Storage, Events, Vibration, Apache Cordova, Cordova Native Notification etc.

<< Back to CREATING

Creating first Cordova Application

All the required components for creating a Cordova application are already installed. So, let's create the first Cordova application. For creating a Cordova application, you must follow these steps:

Step 1: First of all, check the node.js version in command prompt to check whether it is properly installed or not.

Type the following command in command prompt -> node --version

Creating first Cordova Application

If it shows the current version of node.js application, it means that node.js is properly installed on your system.

Creating first Cordova Application

Step 2: Then, type npm on the command prompt.

Creating first Cordova Application

If the npm module is properly installed on your system, then the command will be executed:

Creating first Cordova Application

Step 3: We have already installed Cordova in our system. If you did not install it, you can simply do that by this specific command->

npm install -g cordova 

This command install Cordova in your system. You can also check the version of Cordova by using the below command:

cordova --version

Creating first Cordova Application

Step 4: Now, create the Cordova application on the desktop. First, we have to change our default directory to the desktop.

Type the below command on command prompt to change the default directory.

cd Desktop

The above command is responsible for creating our application on the Desktop.

Step 5: To create our first Cordova application, we have to write the below command on the command prompt.

cordova create app com.xyz.app app

The above command creates our first application on the desktop with necessary files, folders and directory structure.

Creating first Cordova Application
  • com.xyz.app specify the domain name of the application in reverse notation.
  • app defines the name of application.

The above command makes a new folder app on the desktop that contains these folders:

Creating first Cordova Application

Add Platform

If we want to add any platform in our application, we can simply do it by following these steps:

Step 5: First of all, we have to move to that directory that we have created for building the application i.e., app and type dir for showing the current directory.

Creating first Cordova Application

Step 6: By adding a new platform, we can simply deploy our application. Type the below command to create an Android platform.

cordova platform add android --save

Creating first Cordova Application

Step 7: We also need to install PhoneGap for serving the application. To install the PhoneGap module, we must have to type the below command:

npm install -g phonegap

Creating first Cordova Application

Step 8: After installing PhoneGap, we also need to install the Android SDK for adding a platform to our application. We can install it from its official website https://developer.android.com/studio.

At bottom of the page, we can find command line tools and download the Android SDK tools package for windows platform.

Creating first Cordova Application

After installing Android platform for our application, we can a see that a new folder is created in platforms folder.

Creating first Cordova Application

Step 9: Go to that folder where you have installed Android SDK in your system and click on tools folder and copy its path.

Creating first Cordova Application

Step 10: Now, open environment variables in your system and click on the path variable.

Creating first Cordova Application

Step 11: Add a new path by pasting the path in the path variable.

Step12: After that, copy the platform-tools path and paste it into the path variable.

Creating first Cordova Application

Step 13: Once you done all of that, run your app in the browser by typing the following command in command prompt:

phonegap serve

This command starts the server and listen IP address and port number. For running your application in browser, copy the IP address and paste it into the browser.

This will run your application in browser:

Creating first Cordova Application
Next TopicConfig.xml file




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf