Install Android development environment on Windows 7

2010-11-01
About a year ago I wrote a blog post about how to get started with Android development on Windows. At lot of new versions has been released since then, even though the basic packages needed are the same. This is a recap of what to download and how to set it up in order to develop Android applications on Windows 7 (64-bit).

My background is primarily in Microsoft.NET and Microsoft Visual Studio, so it did feel a little different when I first entered the world of Java and Android development. But once you get past those initial hurdles, it isn’t as different as you first might have thought.

These are the steps to get started with Android development on Windows. Should work on any Windows version, but I’m using Windows 7 64-bit.

  1. Download and install Java SDK.
  2. Download and unzip Android SDK.
  3. Run “SDK Manager” from Android SDK to download the platform versions.
  4. Download and unzip Eclipse.
  5. Install the Android plugin for Eclipse and point to the Android SDK.

You can read the instructions here, or watch a screencast I made describing the same procedure:

http://vimeo.com/16392228

Download and install Java SDK

You’ll find the Java SDK here:

http://www.oracle.com/technetwork/java/javase/downloads/index.html

Click the “Download JDK” button and choose the Windows version you have from the Platform combobox. You don’t have to register to download. I ended up downloading a file called “jdk-6u22-windows-x64.exe”. Run it and accept all defaults to complete the installation.

Download and unzip Android SDK

The Android SDK doesn’t have an install executable, but rather a zip file and a utility called “SDK Manager.exe”. Begin by downloading the sdk from here:

http://developer.android.com/sdk/index.html

Unzip the file to any location you want. I put it in “C:\Android\SDK”. Inside that folder, you’ll find the executable “SDK Manager.exe”. Run it. Every time you run that application, it will look for updates to anything you’ve downloaded previously with the same tool. The first time it will default to download all platform versions of Android except the Google specific ones. I’d recommend selecting Cancel at this initial update dialog, and then download what you need from “Available packages” instead.

The Android platform has been released in several versions since its initial offering of version 1.0. Every Android application will require a specific version, but will of course work on all subsequent versions too (at least in a perfect world). Today, I recommend that you target version 2.1 as the least common denominator. But note that there might still be users and phones of at least version 1.6 that might be of interest to you. Anyway, this means that I would download version 2.1 and the latest version 2.2. They don’t really take up that much disk space (maybe ~100MB per version?), so it won’t hurt you too much to download them all either.

Also, every Android platform version comes in a “Android plain vanilla” variant and a “Google APIs” variant. The only differences between those two are that “Google APIs” variant will include the ability to use Google Maps component and some other Google specific APIs that some Android devices might not support. I found this naming to be a little strange at first, but note that “Google APIs” includes everything in “Android plain vanilla” too.

The point is that if your application doesn’t need things such as Google Map component, you will be targeting more devices if you choose to develop for “Android plain vanilla”. As far as I know, all commonly sold Android phones support the Google APIs and it is only simpler media players and maybe cheap tablets that might not have chosen to support Google APIs (since I assume the manufacturer pays licensing fees to Google for that).

Run “SDK Manager” from Android SDK to download the platform versions

So, running “SDK Manager”, cancelling on the first update dialog box, you’ll move on to “Available packages”. I recommend checking the following items and then click “Install selected”: (revision numbers can of course have changed since I wrote this)

You’ll need to “Accept all” licenses and then the download should start. You might get a question if it is ok to restart ADB at the end of the installation procedure, which it is!

Download and unzip Eclipse

You don’t have to use Eclipse. You could stop here and use a command line utility from the Android SDK to create project skeletons and edit the files with any text file editor. But I think you’ll enjoy the full development environment of Eclipse, even though it seems to have gotten its share of complaints over the years.

Download Eclipse from here:

http://www.eclipse.org/downloads/

The first option of “Eclipse IDE for Java Developers” is what you want, and click the link to the right depending on what Windows version you’re on. I ended up downloading “eclipse-java-helios-SR1-win32-x86_64.zip”.

Eclipse doesn’t have an install at all. Just unzip the files into any folder you like and start the environment with “eclipse.exe”.

Install the Android plugin for Eclipse and point to the Android SDK

Inside Eclipse, you need to do a few things before you can create your first Android project. When you start Eclipse, you choose your “Workspace”. Just accept the default. This is the base folder where you will put all of your projects, and can of course be changed later on.

Now, do the following:

  1. Select Help menu
  2. Install new software
  3. Add
  4. Type any Name, like “Android”
  5. Paste this address in Location: https://dl-ssl.google.com/android/eclipse/
  6. OK
  7. After a few seconds, the list should contain “Developer Tools” and there you’ll find “Android DDMS” and “Android Development Tools”.
  8. Select both and then Next
  9. Continue with the download and install. You’ll be asked to restart Eclipse at the end. Do that.

Back in Eclipse with the Android plugin now installed, you also need to:

  1. Select Window menu
  2. Preferences
  3. Android
  4. Click Browse button next to “SDK Location”
  5. Point to the folder where you unzipped the Android SDK previously. For me, that would be “C:\Android\SDK” (where the “SDK Manager.exe” is located)
  6. OK
  7. Apply
  8. After a few seconds the list should fill with the Android platforms you chose to download with “SDK Manager” previously
  9. OK

That’s it!

Create your first Android project

Now you should be able to create your first Android project. Still in Eclipse:

  1. Select File menu
  2. New
  3. Project
  4. Android, Android Project
  5. Next
  6. Project name: My first project
  7. Build Target, Target Name: check any platform version you’d like to start with
  8. Application name: MyFirstProject
  9. Package name: com.myname.MyFirstProject
  10. Create Activity: (checked) MainActivity
  11. Min SDK Version: (can be left empty)
  12. Next
  13. Finish (no test project for your first attempt)

Now, right-click the project name in the left pane and choose “Run as” and then “1 Android Application”. The emulator should start and after some time (it IS really slow to start), you’ll be running your first Android application. If the emulator starts, but not your application, just keep the emulator running and switch back to Eclipse and execute the “Run as” command again. Sometimes it fails on the first attempt.

36 Responses to “Install Android development environment on Windows 7”

  1. Andreas says:

    Thank you very much!
    Please consider adding that you have to run SDK Manager with Admin-Rights.

  2. admin says:

    @Andreas Good point, however I think it is only necessary if you’ve put SDK Manager in a protected location like “C:\Program Files” (or the equivalent for your local language). Anyway, I always run SDK Manager as a normal user and have not found any issues with that yet (located in C:\Android\SDK with full permissons for myself). I think I should add info about setting full permissions on the folder, and that should fix it.

  3. Andreas says:

    Ah ok! That might have been the problem!
    Thanks again!
    Great work this tutorial!

  4. It might be worth noting that the 64 bit JDK will only work with the ZIP install of the Android SDK, not the Windows Installer version: http://savagelook.com/blog/android/android-sdk-windows-installer-jdk-64-bit-fail

  5. You need to create an Android Virtual Device before the test program (last step) will run.

  6. Alkan ARSLAN says:

    Teşekürler güzel bir yazı.

  7. Carlos Rimola says:

    I just want to thank you for your excellent description of setting up the Android Development Environment w/ Eclipse. I am up and running! A few [minor] things have changed but I was able to figure them out. Consider keeping this as a live Reference. Thanks again!

  8. ali says:

    very helpful…. thanks man!!

  9. Red says:

    I kept getting this error…

    “Unable to connect to repository https://dl-ssl.google.com/android/eclipse/content.xml

    Googling it just frustrates you becuase everyone says the same thing or links to the same place. You can go in circles trying to figure it out. But I managed to! If your having the same problem and have tried changing the “https” to “http”, or added “site.xml” or “content.xml” to the end and still had no luck, then keep reading.

    Solution: (It worked for me, I hope it works for everyone else)
    1. Open Eclipse (obviously)
    2. In the menus at the top, select “Windows” then “Preferences”
    3. In Preference window, expand the first group called “General”
    4. Select “Network Connections”
    5. Set your “Active Provider” to “Direct”
    6. Click “Apply” and then “Ok” and try to install your repositories again

    This is what I figured out and it seemed to work immediately after I changed my Active Provider. I believe mine was set to Native by default. I have’t tried the Manual setting but I know direct is working for me becuase it was the only thing I changed since my last failed attempt at getting the android plugin to install.

    Hope this helps someone!

  10. Alex says:

    Excellent and very well explained

  11. Thanks for the excellent walkthrough. I’ve had my share of problems setting this thing up but now I am ready to develop. Thanks!

  12. Jon says:

    I did download the SDK. But the SDK manager does not run like the one shown in screenshots. It just blinks and disappears. I run it with admin rights but still the same

    • Dean says:

      There are loads of articles around that will tell you to set up an environment variable JAVA_PATH = and add it your path, along with the android sdk path. It helped on one machine I installed on.

      Do that, but if it still doesn’t fix it, just add the ADT Plugin to eclipse, and after restarting eclipse you will see the SDK Manager in the eclipse Help menu. By running SDK Manager through eclipse I found I could get past all installation problems.

  13. rajshekhar says:

    I want all android requrement software
    and
    also
    some example of android

  14. Geoff K says:

    Very grateful for this – a few variations since published (see comment 13 – I ran android.bat to launch SDK)

  15. Koushtav says:

    THANKS SIR!
    Really helpful and works fine as stated above.

  16. sorry i able to install jdk-7u11-windows-x64.exe in window 7
    please help me :)

  17. Madhu says:

    Back in Eclipse with the Android plugin now installed, you also need to:
    Select Window menu
    Preferences
    “Android”.

    I’m not getting the Android button in Preferences window.

  18. Mayaa says:

    Nice post! Thanks for your clear explanation.. I found this http://androidtechstuffs.blogspot.in/2012/12/configure-android-on-pc.html also useful. Have a look, might help you..

  19. ravi chaudhary says:

    Can any one help me with this

    i am getting this , whenever i go to help/install new software..

    HTTP Proxy Authentication Required: http://dl-ssl.google.com/android/eclipse/content.xml
    HTTP Proxy Authentication Required: http://dl-ssl.google.com/android/eclipse/content.xml
    Proxy Authentication Required

    Thanx

  20. ravi chaudhary says:

    i got it now

  21. Arun koushik.mallela says:

    Thanks, good explanation it was very helpful for me.

  22. Josue Martinez says:

    I am having issues to run Eclipse because of this error: A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse. No Java virtual machine was found after searching the following locations… in your current PATH.

  23. Priya says:

    Thank u so much ..

  24. Upadate information in android

  25. Thanghadurai says:

    hi sir
    i cant able to JAVA SDK instead i can see only JAVA JDK in the websites which i searched.what to do?

    • mikeplate says:

      @Thanghadurai Yes, not sure if the name was changed at any point (the article is quite old), but today JDK=”Java SDK” so you are fine to go with JDK.

  26. Anonymous says:

    awesum…………. Tnx a lot

  27. LAKSHMAN says:

    Thanks, its very much helpful for me,i am begging my android project , How to start it through eclipse . please give me steps to do ….

  28. Santosh says:

    How to Install Downloaded App in it
    pls send me on email

  29. Harsha says:

    Thank u very much…:-)

  30. I feel this is one of the such a lot significant info for me. And i’m happy studying your article. However wanna statement on some normal issues, The web site taste is wonderful, the articles is actually great : D. Good process, cheers

  31. suman says:

    thanks a lot for this gud article

  32. Srinivas says:

    Thank you very much for this tutorial.

    it works so nice for me really.

    regards

    Srinivas

Leave a Reply

Twitter: @mikeplate