Guide to Install and Setup IntelliJ IDEA for Android App Development
To start developing Android applications, one has to set up a proper development environment. It facilitates developers to use the tools needed in creating an app and ensure that all operations/processes carried out in a smooth manner. An IDE(Integrated Development Environment) is a complete application suite that provides services like writing and editing of source code, building executable files, and debugging. IntelliJ IDEA is one of the popular IDE that is used for developing android applications. This article covers the step-by-step approach to install and setup the IntelliJ IDEA IDE on the computer system in order to start the android app development journey.
Step 1: Download and Install Oracle Java Development Kit (JDK)
To write Android application source files in Java programming language, JDK is needed to be installed. It is a collection of libraries and compiler which will run the java code on the system. Visit this link to download the JDK file that is compatible with your computer system. One should not get confused between JRE and JDK, both are different things and here the requirement is only JDK.
Step 2: Download and Install Android Software Development Kit(SDK)
The Android SDK is a collection of all the software development tools and libraries needed in developing android applications. The SDK tools are necessary for writing program codes and it also helps in testing the code files. These features guarantee a smooth flow of the development process. In order to use IDEs other than Android Studio, one has to download Android SDK packages separately.
Visit this link and navigate downwards to the “Command line tools only” section. Choose the appropriate SDK tool package and click on the package name.
Following links can also be used to download the same:
- Windows: https://dl.google.com/android/repository/sdk-tools-windows-4333796.zip
- MacOSX: https://dl.google.com/android/repository/sdk-tools-darwin-4333796.zip
- Linux: https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
After the zip file of SDK tools get downloaded, extract the contents to directory C:\Android\android-sdk. Further, navigate to C:\Android\android-sdk\tools\bin and open a command prompt in that directory(in windows, clean the top file explorer bar and write “cmd” then press Enter).
In the command prompt, run the following to download the android package:
Execute this command to update everything:
Step 3: Open SDK Manager
Once the command prompt updates all files of the Android SDK package, navigate to C:\Android\android-sdk\tools\bin and run the sdkmanager with administrator’s privileges. Let the command prompt fetch and download any required file. Accept the terms and conditions(if asked).
Step 4: Download and install IntelliJ IDEA
The IntelliJ IDEA Community Edition is free to use and can be downloaded from this link. Download the .exe file and install the software on your computer.
Step 5: Configure the IntelliJ IDEA
Create a new project in this IDE by clicking File => New => Project. Further, select Android from the left panel, and click on the Install SDK button. In the next dialog box, provide the path of SDK installed in the system(browse file explorer and choose C:\Android\android-sdk). Select both components i.e., API and Android SDK to install and click Next.
Review the SDK folder path, download size and click Next, wait till the setup download all files then click Finish. A screen will appear with the text “Android SDK is installed successfully”, click Next.
Step 6: Create the First application
Once all configuration has been done, the IDE is all set to develop android applications. Select the desired activity template(for a simple Hello World application, Empty Activity has been selected).
Provide a name to the application, select project location from file explorer, and choose the desired language as well as minimum SDK version, click on Finish. The IDE will take some time to load the gradel files for the application. After completion, the source code will appear on the screen.
Step 7: Configure Virtual Device(Emulator)
Emulators run the android applications on the computer system i.e., developers don’t need a real android device to run/test the applications. To set up an Emulator, open the AVD manager and click on Create Virtual Device.
Choose a device of your choice. Pay attention to the Play store column, the device having a play store icon adjacent to it means that the Google play store is pre-installed in that device. After selection, click Next.
Every android device needs an OS version, thus one needs to download the desired OS for the Emulator. Choose one of the OS versions, click on the “Download” button, accept the terms and conditions of the software and wait for the complete installation. Once done, click Finish.
Choose the downloaded OS version for the emulator and click Next. Give a name to the Android Virtual device and leave all other settings default, click Finish.
The device name will now appear in the AVD manager list. Click on the Run button of the device(present in the “Actions” column of AVD manager) to launch the device as an emulator. The “Hello World” Application will run on the device.