In this article we are going to discuss how to setup Ionic environment in your machine and run android app in that. Ionic is one of the powerful tool which supports multiple platforms like Android, IOS, Windows, etc…
Tools to be installed to setup Ionic:
To work with Ionic we need following set of tools to be installed in your machine.
1. Android SDK (https://developer.android.com/studio/)
2. js (https://nodejs.org )
Let look into each with step by step implementations,
Android SDK Setup:
- Download android studio in following link
- Once android studio is downloaded please install it with admin permission.
- If you want to know more about android studio installation steps please follow below blog
Please download the latest version of node.js and install, once installed you will get the node.js command prompt which will look like below,
We have the required tools ready, now we need to set up the Java environment path.
Environment Path Setup:
Please follow the below steps to setup up the JAVA environment path
1. Go to the following location,
C: -> Program Files -> Java folder -> JDK -> Bin and copy the folder path from windows explorer.
Example: - C:\Program Files\Java\jdk1.8.0_152\bin
2. Now, go to control panel -> System and Security -> System ->Advanced System Securities (it will be displayed in left side). You will be prompted with a popup window and Environment Variables button will be there in the bottom of the popup under the Advanced
3. Now you will get another popup with list of system environment variables and click NEW button to setup environment path for JAVA which will look like below,
4. Now you can give a variable name as JAVA then the variable value is your JDK path (which you have copied in the step 1) and click OK.
Now we have successfully setup the android setup in our machine, let’s see how to install ionic package.
Setup Ionic package
1. Open your node.js comment prompt and install IONIC Plugins by using the below command
npm install -g cordova ionic
Once required node packages are downloaded for ionic we are set to go to create ionic app.
2. Create a project directory and go to that project directory in node.js command prompt
3. Create an ionic project using the below command
ionic start myApp blank
4. Now you need to add android platform in the ionic project with the below command
cordova platform add android.
5. Once the platform is added then you can run the project with below command
ionic Cordova run android.
which will show you android emulator with empty page.
In this article, we have discussed how to setup android environment with Ionic framework and create a new ionic project with android platform. I will explain how to setup IOS in ionic environment in my next article.
If you have any questions/issues about this article, please let me know in comments.