Wednesday, October 3, 2012

Android development using IntelliJ part 1

Open source is about choice, they say. So here is one more choice, use IntelliJ IDE for development of android apps.

IntelliJ is a good IDE for Java development by JetBRAINS. It comes in two flavours, free community edition and  paid ultimate edition. Both can be downloaded from here.

I am using free community edition for this tutorial. Which according to site has "Powerful environment for building Google Android apps". Though I will left that for readers to decide.

Update: To install android sdk tools please refer this post.

Installation is pretty straightforward, just unzip it in a convenient location and run file from "bin" directory. Select File -> New Project and you shall be welcomed by this dialog box

Click next and you will get this screen

Enter project name, select type as "Android Module", and click next to get following screen.

Click next with settings remains intact.

In above screen select the emulator device, one thing which surprised me was that there was no option to select build target. I manually changed that to Android API level 8 ( Android 2.2) in AndrodManifest.xml (android:minSdkVersion="8").

Just click on run and you will have your app running in emulator.

Update 2: One difference I noticed between eclipse and IntelliJ is that running app from eclipse twice runs a new instance of emulator, while IntelliJ does the , well intelligent thing to connect to the already running emulator and initiate the app within. Probably those who are well versed with eclipse will be able to tell the peculiar behavior of eclipse.

Comparing to my previous jEdit tutorial, this was short and easy. Well that's what a IDE is supposed to be, but in my personal opinion one know about the internal working more if one uses a simple editor and command line. However if you are short of time, using IDE will save you lots of time.

In forthcoming parts I will try to give examples of creating android apps step by step. Consider this a group study rather than a conventional classroom teaching as I myself is learning android programming.

All suggestions of improvement are welcome. Thanks for reading.