Developing Your First Android Application with IntelliJ IDEA on Ubuntu

Developing Your First Android Application with IntelliJ IDEA on Ubuntu
Developing Your First Android Application with IntelliJ IDEA on Ubuntu
If you are a programmer or have just started learning programming and you are loving the Smart-phone technology, then you would definitely love Android Programming as Android is the Future of Mobile Technology. If you know Java than things will be lot easier to learn. Although people with knowledge of other Programming languages can also learn it easily. You just need to enjoy it, because Programming is Fun and to create something makes us feel great, no matter what it is and Android makes it more beautiful.

So lets start with developing a basic android application with IntelliJ IDEA  which is an official Android IDE. Most of the tutorials on Internet are about using the Eclipse IDE, but IDEA is better in terms of performance as Eclipse really slows down the system. But an IDE should not be a constraint for you for developing the application. So if you enjoy working on Eclipse, you keep going with it. But try to work on IDEA also, you can feel the difference.

Let start with developing our first application on Ubuntu, but before that we need to set up the environment for application development. Two basic platforms required for starting Android Application Development are:

1. Java SDK:       You can get it Here
2. Android SDK: You can get it Here

Follow the required installation instructions to get the system ready for Android Development. You can skip the Eclipse ADT plug-in part as we are Using a Different IDE. Once you are done with the Required platform setup, you need to install the IntelliJ IDEA IDE which you can get it Here. Since we are working on Ubuntu, you need to get the Linux version of the IDE. Download and Extract the requited gz file and then inside the bin folder, run the idea.sh file to start the application. You should see the page like this:

Click on Create New Project and the following should be displayed.


Click Next and you should see below Screen. Enter the Project Name as shown
 and Select Module Type as Android.

  

Click Next and you should see below screen and by default create Source directory radio button should be selected. Leave it as it is. You src directory will contain files related to the application source.


Click Next and you should see below screen or before that you could one more screen where the application will ask for JAVA SDK path. Select that path and after that you have to select path for the Android SDK path which you can see in the top in below screenshot.


You should be prompted to select the SDK path as shown below:


Also in the previous screen-shot you can see the option for selecting the Target device where you will run your application.  We will be using the Emulator to run our application. So we will create a Virtual Device to run the application. A Virtual device is same as Physical device and it will show us the behavior of the application on the physical device. Select Emulator and click on Prefer virtual Device selection box to create the Virtual Device. You should see screen like below:


Give your virtual device a name and target platform for which you are simulating the behavior. After adding the details Click Create AVD and then you can choose the created Virtual Device in the Emulator option and then click Finish. You just created your first Android Project. :). 

Under Project Explorer, you can see the Project just created. And Click under src directory, you could see that the package created has the activity file created automatically, which is the main file for your application. 


Click the Green arrow button on the top to run your application. The IDE will launch the virtual Device and will run your application and the output should look like below.



Your first Android Application is ready!!