


- Ionic is a cross-platform, which means we can write a single code for the multiple platforms.
- To create an Ionic Application, we require basic Web technologies like HTML5, CSS, JavaScript, which means we don’t require knowledge of any platform-specific language.
- We can change the look of the Application to match the native standards for each platform.
- Ionic Application is a simple, easy interface, easy to update and maintain.
Disadvantages
- Some time testing becomes a big issue in such types of Applications because the Web Browser doesn’t always give errors of any wrong code but when we build the Application for the native platform, then we will face the issue.
- Ionic Application requires plugins for the native Application that sometimes becomes a compatibility issue.
- In some cases, Ionic Applications are slower than the native Applications.
- We can’t use Ionic for heavily graphical stuff like video games or 3D.
After a brief introduction of Ionic and discussing the advantages and disadvantages of Ionic, let’s focus on another important point about Ionic.




Install npm
Install Cordova
Now, install the libraries for Cordova, using “npm install –g cordova”. This command downloads the libraries and packages, which are required for the set up of Cordova.
After successful downloading of Cordova packages, now run “cordova –v” command to check the version of Cordova.
Step 3
Install Ionic
Run “npm install –g ionic” command to download the libraries for Ionic setup. After successful installation, run “ionic –v” command to check the installed version of Ionic.
Step 4 Install Bower
Similar to previous command, run “npm install –g bower” to install the libraries for bower. Bower is a package manager, which is similar to “npm” and used to install third-party JavaScript libraries. After successful installation, run “bower –v” command to check the installed version of bower.
Step 5
Install Gulp
Run “npm install –v gulp” command to install the libraries for Gulp. Gulp is used to build JavaScript code and libraries, which are used by Ionic to build the project.
After successful installation, run “gulp –v” command to check the version of the installed Gulp.
Create a Demo App
After installation of all the required libraries, now we learn how to create an Application in Ionic and built for Android and iOS platform.
First, change your directory, where you want to create your project and run the “ionic start newAPP tabs”. This command creates an Ionic Application with tabs template. Ionic provides some pre-generated templates like tabs, menu, and blank.
This command downloads the template packages for tabs Application.
You can check that the following files or directories are added in myApp folder.
Now, we run this project in the Web Browser, so change your directory to myApp and run the “ionic serve” command.
Now, the screen, shown below will open in the Web Browser. This Application’s template is tab-based. In this app, we can see three tabs- Status, chat, and Account tabs, where three tabs contains content, shown below.
Status Tab
Chats Tab
Account Tab
Build Application for Android and IOS platform
So far our Application “myAPP” is just a Web Application. Now, we build and add support files for the Android and IOS platforms. First of all, press “q” to quit. Enter the “ionic platform add android” command for an Android platform. These commands add the Android support files for our Application.
You can use “ionic platform add IOS” to add the support files for IOS. I only have an Android device so, I only built and run this Application for an Android.
Build the Application
For it, we use the “ionic build android” command.
This builds a process, which will generate an “apk” file for our Application. Now, we have “apk” file, so let’s run this “apk” file and test the application in an Android device or emulator.
Now, run the “ionic emulate android” command. This command launches your Application in an Android emulator if you have SDK. Let’s check our Application Android emulator.
Our application is running on an Android emulator, which is a virtual device. Now, we try to launch this application on a real device.
First of all connect your device, using the USB cable and enable the “USB debugging” mode in your Android device.
Now, run the “ionic run android” command. The command launches this Application into your device. I am sharing my device’s screen image, which is running this Application.
One of the major advantages of ionic is that you can access your device’s screen on your Browser on a remote basis. Now, I will tell you, how we can access the device’s screen on our Browser.
First, run the “ionic run android” command. Afterward, right-click on the Browser Window and select ”inspect element” option. Afterward “inspect element” option, go to “More Tools” and click on “Remote device” option.
Now, a screen will open, where you can see your device name. If your device name is not visible, it means your device is not connected properly.
If your device is connected properly, then you can see your device’s URL and click on “inspect option”.
When you click on the “inspect” option, the screen shown below will open.
On this screen, you will get an image of the screen, which currently opens in your device.
Here, you can inspect and edit elements just like a Website and the change will be reflected.
Ionic provides live testing, which means whenever we change any code in either project file or in a Web Browser, the effect will be reflected immediately on your Browser screen and also on your mobile device.
I replaced the “Welcome to Ionic” with “Hello Pankaj” and you can see that this change is immediately reflected on my Browser and device screen also.
Structure of the project
After all installation and environment set up, now we will check out the structure of our project and get the use of each file and directory present in our project.
When you open your project, you see the files and directories, mentioned below.
Hooks
It is used for Cordova commands customization and for building the automated processes during the build process.
Node_modules
We installed all the dependency, using the “npm”. This folder contains files for Cordova, Gulp, Bower, which we installed, using “npm”.
Platform
This directory contains Android and IOS project files.
Plugins
It contains Cordova plugins wherever you installed any Cordova plugin, which is installed here.
Res
This directory contains the folder for different sizes of images and orientation for an Android and IOS.
Resource
This folder contains icons and splashes for Android and IOS.
SCSS
Ionic core is built with SCSS, so the folder contains SCSS files for Ionic.
WWW
This folder is the most important part of any Cordova project. This is the folder, where we work. All the project related HTML, CSS and JavaScript files are present in this folder.



After installing all the required files, let’s check our “myApp” directory. You will find the “platform” folder is added into the app and this folder contains all the files to run our application on an Android device.






















- Bowerrc
This contains bower configuration files.
- Editorconfig
It contains editor configuration files.
- Gitignore
It defines which part of the project will not be present when you upload your project to the Git repository.
- Bower.json
It defines dependencies for bpm(Bower Package Manager)
- Config.xml
It contains configuration for Cordova like minimum SDK version for an Android, resource for the splash screen, etc.
- gulpfile.js
It is used to create automated tasks used by gulp task manager.
- Ionic.config.json
It defines Ionic project name and Id.
- Package.json
It contains all the information about projects like name, version, plugins, and dependencies.

Elavarasan RPosted Mar 13, 2020, 4:17 AM
great, nice article useful to me..
Muthu KumarPosted Mar 6, 2019, 4:29 AM
Very Nice Article. Deep Explanation is Awesome..
Shubham JainPosted Nov 22, 2017, 2:19 AM
Thanks for sharing this with us:)
Saravanan VPosted Sep 8, 2017, 9:50 AM
Neatly presented.. useful article for beginners...
Srinivasan K KPosted Nov 9, 2016, 12:04 AM
This post is a really quick start guide for everyone who wants to start an ionic app. Hats of Pankaj...
Kiran MaramPosted Nov 4, 2016, 2:51 PM
Good one , it's very useful for starters