Skip to content

Eclipse Indigo for Android Development on Mac OS X Snow Leopard

632eclipseI decided to install the latest version of Eclipse, Indigo, and configure it to do Android application development. My specific final target is to build the VLC Player for Android. Below are my notes for installing such an Eclipse configuration for Android development on a clean Mac OS X Snow Leopard system.

Note: These instructions also work for the latest Eclipse Juno version. Just replace references to Indigo with Juno.

Install Android SDK

  1. Download latest Android SDK (I downloaded “android-sdk_r12-mac_x86.zip”).
  2. Unzip and move the extracted “android-sdk-mac_x86” directory to “/Applications”, so you end up with “/Applications/android-sdk-mac_x86”.
  3. Add the following to the end of your bash environment configuration file “~/.profile”. (The tilde symbol ~ translates into your home directory “/Users/your_username”.)
    export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
    export ANDROID_SDK=/Applications/android-sdk-mac_x86
    export PATH=$PATH:$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools
    export NO_NEON=1

    Some details on the above:

    • Mac OS X Snow Leopard comes with the 64bit version of Java 1.6 installed by default. We are just setting the JAVA_HOME to point at it.
    • The PATH is optional but will make it easy for you to run the Android SDK Manager by typing “android” or the Android Debug Bridge by typing “adb” in the Terminal.
    • Set NO_NEON to prevent Android compilation from using the Neon CPU enhancements which are not supported on all Android devices (including the Emulator).
  4. Run the Android SDK Manager, by launching $ANDROID_SDK/tools/android, to install support for one or more Android OS platform versions. (It is mandatory that you install at least one OS platform version.)
    • Click on “Installed packages” to see what is installed by default, usually just the Android SDK Tool and Platform-tools.
    • Click on “Available packages”, expand “Android Repository”, and select the SDK Platform OS version that you want to develop for. For example, if you wish to do Honeycomb development (or your Android phone has Honeycomb), you can check “SDK Platform Android 3.0, API 11, revision 3”. You might wish to also get the samples by checking “Samples for SDK API 11, revision 1”.

    Optionally, while we have the Android SDK Manager opened, you can create an emulator by clicking on “Virtual devices”:

    • Click the “New…” button, name your emulator, select a platform OS version for the target, input a SD Card size like 32 or more, and hit the “Create AVD” button. The SD Card size is optional but some programs may fail to run if a SD Card is not present.
  5. Periodically, to update your installation, you may wish to go to “Installed packages” and click the “Update All…” button. This will return all updates (even for items not installed) which are applicable; you will need to select Reject for those items which you don’t want to install/update.

Install Android NDK

We will need the Android Native Development Kit (NDK) in order to compile the Android VLC JNI library:

  1. Download the latest Android NDK (I downloaded “android-ndk-r6-darwin-x86.tar.bz2”).
  2. Unzip and move the extracted “android-ndk-r6” directory to “/Applications”, so you end up with “/Applications/android-ndk-r6”.
  3. Edit “~/.profile” to add the following:
    export ANDROID_NDK=/Applications/android-ndk-r5b
    export PATH=$PATH:$ANDROID_NDK:$ANDROID_NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin

    The PATH is optional but will make it easy for you to run “ndk-build” from a Terminal. Also, when compiling projects like VLC, the android prebuilt tool will be required to be in the path.

Install Eclipse

  1. Download the latest Eclipse.
    • Select “Mac OS X (Cocoa)” in the “Packages for” drop-down listbox at the top to filter for only Mac versions.
    • Find the Eclipse flavor you want. If you aren’t sure, I recommend getting “Eclipse IDE for Java Developers”. Click on the “Mac OS X 64 Bit” to the right to download. (I downloaded “eclipse-java-indigo-macosx-cocoa-x86_64.tar.gz”.)
  2. Unzip and copy the extracted “eclipse” directory to “/Applications”, so you will end up with “/Applications/eclipse”.
  3. Start Eclipse and select your workspace location. (If you select an old location which was used by an older version of Eclipse, make sure to delete the “.metadata” sub-directory there first; otherwise, your new Eclipse will display old plug-ins and IDE modes which it may not have installed.)

Change How Eclipse Handles Search Results

In the recent versions of Eclipse, the default behavior for search is to reuse the editor. This default behavior can be annoying because it prevents you from being able to simultaneously view more than one search result. Opening a new search result would reuse the editor tab and cause the previous search result to become unavailable. To configure Eclipse to open each search result in a new editor tab, do the following:

  1. Go to menu “Eclipse->Preferences->General->Search”.
  2. Uncheck the “Reuse editors to show matches” option.

Install Android Eclipse Plugin (ADT)

Add the ADT to Eclipse:

  1. Run Eclipse.
  2. Select Help->Install New Software…
  3. Input “https://dl-ssl.google.com/android/eclipse/” into the “Work with:” field. Hit Enter. The table below should populate automatically. (You can use the optional Add button if you want to bookmark this URL.)
  4. In the table, expand “Developer Tools” to see what it contains.
  5. Check the “Developer Tools” box to select all. (If you want just the minimum, check only “Android Development Tools”.)
  6. Click Next, Next, select “I accept the terms of the license agreements” radio button, and click Finish.
  7. If the Security Warning dialog about the “unsigned content” appears, click Ok to accept.
  8. Click on “Restart Now” to restart Eclipse.

Configure the ADT:

  1. Under Eclipse, go to menu Eclipse->Preferences.
  2. Select Android.
  3. In the “SDK Location”, browse to your android install directory (directory pointed at by $ANDROID_SDK or “/Applications/android-sdk-mac_x86”).
  4. Hit Apply and you should see the Android platform versions you installed earlier populate the table.
  5. Hit Ok to close the dialog.

Install Eclipse IDEs for PHP and Javascript

Optionally, add the Javascript Development Tool (JDT):

  1. Go to Eclipse menu Help->Install New Software…
  2. Click on the dropdown arrow for the “Work with:” box and select “Indigo – http://download.eclipse.org/releases/indigo”. (If you don’t see this entry, just type in the URL manually.) The table will populate with a bunch of Indigo-compatible plugins.
  3. Type “javascript” into the “type filter text” field to show only the Javascript related plugins.
  4. Check the “JavaScript Development Tools” (for example, under “Programming Languages”) and click Next, Next, accept the license, Finish.
  5. Click on “Restart Now” to restart Eclipse.

Optionally, add the PHP Development Tool (PDT) by repeating the steps above, filtering on “PHP” instead, and selecting “PHP Development Tools” for installation.

Install Subversion Eclipse Plugin (Subclipse) and Compile Android VLC Player

If interested, see the next post for instructions on installing the Subversion Eclipse Plugin (Subclipse) and compiling the VLC Player for Android.

One Comment

  1. Rafael Paz

    Thanks man, you saved my day! 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *