Upgrade to IntelliJ

As an Android developer I took the normal road when I started Android development, I used Eclipse and worked with the tools supported by Google through the ADT. But like many developers, I grew tired of the quirkiness of Eclipse and began looking for a better option. I found it in IntelliJ from JetBrains, makes of another favorite tool of mine ReSharper. However, the caveat to IntelliJ is that you wont found as much documentation on setting things up as you will for Eclipse, this blog post is meant to solve that. Lets get started:

1) Get the Android Tools – this may seem like a weird place to start but, it works out b/c the Tools installer will tell you where to find the correct Java Installation, if you don’t already have it. You can download the installer here: installer_r12-windows.exe (Windows Only).

If you are special, like me, you will get this lovely message when you try to install it:

2011-07-25_2109

Follow these instructions to get the CORRECT Java SDK, it must support x86.

2) Downloading the JDK – I always do it this way to make sure I get any new updates to the path that Google has found. The key here is to get the x86 version of Java, x64 doesn’t seem to work at this time. Download the SDK here: jdk-6u26-windows-i586.exe

2011-07-25_2154

3) Installing the JDK – This step is very simple, just follow the instructions and take all the defaults.

4) Get Android Tools and SDK – Now that you have Java, you can run the Installer which will install the SDK and Tools on your machine.

2011-07-25_2232

You might get this message, even though Java is installed. This is a weird error within the installer, the workaround is to hit Back, and then Next, which should fix the problem

2011-07-25_2233

Take the remaining defaults and complete the installer. Understand that at this point you do NOT have the Android platform, only the tools. At the end of the Tools installation, the SDK manager will launch and prompt you to download the platforms. You can pick and choose here, but I always just take everything

2011-07-25_2235

Understand that this will take a few hours, depending on your connection speed. Alternatively, hit “Cancel” here and choose a package from the “Available Packages” list and install that.

You can confirm what you have installed by using Windows Explorer to look at c:\Program Files\android\android-sdk\platforms – there you should see something like this

2011-07-25_2255_001_001

5) Download and Install IntelliJ – While the installation process is proceeding, head over to JetBrains and download IntelliJ Community, here is the link: http://www.jetbrains.com/idea

Using the installer take all the defaults and install the application.

6) Configure IntelliJ – Once the download is complete for Android and you have IntelliJ installed, you can run the application and configure it to support Android. This is a two step process, all of which can be handled by running the “Create Project Wizard” and select the Android Module as the type.

2011-07-25_2258

The next window you are looking for is Project JDK. This will be blank and that is a problem, hit Configure to tell IntelliJ where Java is.

2011-07-25_2259

Simply select the path you installed Java to (mine is c:\Program Files\Java\jdk1.6.0_26) and hit Ok.

With this you now have a JDK that IntelliJ can use. Hitting Next will take you to the Android specific setup screen. The glaring problem is in red

2011-07-25_2302

We have no Android SDK to work with. Its no big deal, just need to tell IntelliJ where our Android SDK is, to that hit the button to the right of the Android SDK dropdown.

Hitting this will open up the following dialog. On this dialog hit the + (indicated by the red arrow) to add an Android SDK reference to the classpath.

2011-07-25_2304

Select the android-sdk (mine is C:\Program Files\Android\android-sdk) folder in your path, this will prompt you with the available platforms at that path. In our case, we have only Android 2.3.3, take that and hit Ok. Note, it may ask for the Java version, select 1.6 in this case (it should be the only one). Below is the completed SDK selection

2011-07-25_2306

Hit Finish and IntelliJ will setup a default Android Hello World application. Congrats, you know have an Android enabled IntelliJ installation. Our next segment will cover getting the emulator going and understanding why we would need multiple emulators (or AVDs).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s