First steps with Android on Intellij IDEA (Windows 7)

This is my personal view on beginning with Android development and is intended for Android beginners with at least some Java experience. I did some Java development before, but had no experience with mobile development at all. I got myself Nexus device and dived into it in October 2012. In the bottom of article you can find couple of useful links which will help you with your development.

I know that Windows isn’t the best environment for development, yet this tutorial should help everyone struggling or having fear to try it on Windows.

Getting started

First you need to download Android SDK. It comes in two versions:

Installer needs to have set JAVAHOME environment variable. If your Java installer didn’t set it, you need to do it manually. Open start menu and type “edit environment variables for your account”. Then click new button, name the variable JAVAHOME and set the value to your JDK installation (e.g. c:\Program Files\Java\jdk1.7.0_17).

After successful installation, open your SDK Manager and install API libraries you want. I recommend to use latest version and the milestone versions such as Gingerbread, which you’ll probably want to support for a while. This is also the place to install Google Maps SDK libraries, Google Play Services libraries or Intel x86 driver for virtual devices.

Android Studio @ Google I/O 13

This year guys from Google decided to directly support new IDE - to be honest my favourite: Intellij IDEA. I know you guys probably like and use Eclipse, but JetBrains IDE family for Java, PHP, Ruby… provide me features under one hood, which no other IDE does.

At Google I/O 2013 Xavier Ducrohet, Tor Norbye and CTO of JetBrains Dmitry Jemerov presented features of new Android plugin for Intellij and IDE based on Intellij IDEA - Android Studio.

I’ve tried Android studio myself. It comes bundled with SDK and everything starting Android developer needs, but it’s still early version and has some bugs. I personally recommend EAP (early access preview) version of Intellij IDEA, which has almost same features and is stable. Play the talk and see the magic.

Setting up Intellij IDEA is easy. After clean install, first you need to set two main things:

That’s everything. Now you can create new project and start trying stuff.

Everything related to build (such as paths, libraries, JAR) is available in Module settings - right click on project root in project explorer or F4 keyboard shortcut. I will go through main options there and try to explain them. To not be just theoretical, imagine Android project with main module with app itself, test module with jUnit tests and library module with ActionBarSherlock library for having action bar in <IceCreamSandwich versions of Android.

If you used Eclipse before, you are probably used to library projects, test projects etc. In IntelliJ, project is created from set of modules - one of them is your main application, another is test module, another library module. See the difference…

In project settings you can go through:

After having everything properly configured here, you are ready to build your application.

Building & Running

IntelliJ let’s you run directly from the toolbar or from run menu. However I recommend to create run configurations from the run - edit configurations submenu. You can preset target device, build params, Activity you want to enter (without editing android.manifest) and many more. Except the main application, you can create configurations for unit test or even XSLT transformation.

When this is ready, you can choose your configuration directly in toolbar and run it without further dialogs. It can be really handy if you need to switch from one configuration to another (e.g. running the tests before deploying the app to your device).


I hope the article gave you some basic overview how things might work. Don’t forget to check references below and feel free to join the discussion.