Home > Android, Programming > Installing Android SDK on Windows XP – Hello World Application

Installing Android SDK on Windows XP – Hello World Application

You’ll find the full details for installing Android SDK at http://developer.android.com/sdk/installing.html. The purpose of this blog entry is to summarize what I had to do to install Android development environment (Android 2.3 SDK (Gingerbread)) on Windows XP.

Before installing the Android SDK per se, you’ll need to install some set of tools used by the SDK. Here are the steps to setup your Windows XP computer for Android development:

1. Install Java Developer Kit (JDK)

You need to go to http://www.oracle.com/technetwork/java/javase/downloads/index.html, select your OS (e.g. Linux, Windows, MAC…) and the file you want to download. I selected Java Platform (JDK), then downloaded Java SE Development Kit 6u23. I got the jdk-6u23-windows-i586.exe which I installed in the default directory, i.e. C:\Program Files\Java\jdk1.6.0_23).

2. Install Eclipse Classic

Then you’ll need to install Eclipse, and open source IDE.

Several versions are available at http://www.eclipse.org/downloads/, but since Google recommends Eclipse Classic, I just download it (version 3.6.1 – Helios) and got the file eclipse-SDK-3.6.1-win32.zip, which I extracted in C:\ (a directory eclipse will be created).

3. Install Android SDK

Now is the time to install the SDK. It will be installed directly, you’ll first need to download the SDK Starter Package, a tools used in install the SDK, The latest version  is available at http://developer.android.com/sdk/index.html. Right now the latest version is revision 8, so I downloaded the installer for Windows XP.  Then run installer_r08-windows.exe to install the starter package. After that start the SDK Manager, click on Available Packages (I selected all) and click on Install Packages. The download will take a while.

4. Install ADT plugin for Eclipse

The ADT (Android Development Tools) plugin for Eclipse is designed to give you a powerful, integrated environment in which to build Android applications.

First start Eclipse (C:\eclipse\eclipse.exe), then select Help->Install New Software, click Add on the right top corner.  In the Add Repository dialog that appears, enter “ADT Plugin” for the Name and the following URL for the Location: https://dl-ssl.google.com/android/eclipse/ (if case of problems, use http instead of https). Then click OK and Next. You should see the list of available tools:

  • Android DDMS (Dalvik Debugger Monitor Server)
  • Android Developer Tools
  • Android Hierarchy Viewer

Android ADT Plugin in  Eclipse 3.6.1 (Helios)

Click Next, tead and accept the license agreements, then click Finish. Finally restart eclipse.

That’s it your system should now be fully configured to develop Android applications.

Hello World Android Application

Google also provides a Hello World application tutorial and quite a few other examples to get started. Here are the step to follow to run the Hello World application:

1. Create an AVD

The first think you’ll have to do is to create an Android Virtual Device (AVD). In Eclipse, go to Window > Android SDK and AVD Manager, select Virtual Devices in the left panel, click New. Type the name of the AVD, for example “my_avd”. Choose a target. The target is the platform (i.e. the version of the Android SDK, such as 2.1) you want to run on the emulator, ignore the other fields for now and click Create AVD.

2. Create a New Android Project

In Eclipse, select File > New > Project. Then select Android -> Android Project and click Next.

Fill in the project details with the following values:

  • Project name: HelloAndroid
  • Application name: Hello, Android
  • Package name: com.example.helloandroid
  • Create Activity: HelloAndroid

Click Finish.

3. Modify the code to add “Hello World” text.

Now open HelloAndroid.java, and modify it to display some text (added lines in Green):

package com.example.helloandroid;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class HelloAndroid extends Activity {
   /** Called when the activity is first created. */
   @Override
   public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       TextView tv = new TextView(this);
       tv.setText("Hello, Android");
       setContentView(tv);
   }
}

4. Run the application

Select Run > Run then “Android Application”. Eclipse will create a new run configuration for your project and start the Android Emulator. The latter took a while on my computer (2 to 3 minutes), this is ready when you see the usual Android UI in the emulator. I noticed some errors the first time, I ran the app (disconnected from target),. If this happen, wait the Android to fully boot in the emulator and Run the application again. You should then see your application (on the left) and the emulator controls on the right.

Android Emulator in Windows XPThat’s it. To know more about the right method to construct a UI in Android, you may want to carry on with the Hello World Tutorial section “Upgrade the UI to an XML Layout” and play around with the other Android tutorials.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

  1. QuickBooks
    September 19th, 2011 at 22:43 | #1

    So competent! I want some infos in this posting for my rapport de stage. Can i have your contact please? We need your permission to quote it :D. Anyway, That’s congrats. Continue.

  2. Isz
    December 5th, 2011 at 11:39 | #2

    Great tutorial,thanks.I expected emulator to appear but it came up wirelessly on my WM8650 7″.Bonus,Isz (keep up the gr8 wrk)

  3. January 21st, 2012 at 13:24 | #3

    Also make sure the installation directory of the Android SDK (e.g.installer_r16-windows.exe) does not contain spaces or you may encounter the following error:

    emulator-arm.exe has encountered a problem and needs to close. We are sorry for the inconvenience.

    while running the emulator.

    The default installation path is C:\Program Files\Android\android-sdk-windows, you may want to change it to C:\Android\sdk.

  4. sandeep
    August 28th, 2012 at 16:54 | #4

    how can i get” ginger bread ” sourcecode for Android-sdk-windows??????????????/

  5. August 28th, 2012 at 16:57 | #5

    @sandeep
    I guess you can use the SDK manager to download the source code. If you can’t find it there, a google search lead me to that site: http://wolfpaulus.com/journal/android-journal/androidsdksource

  6. Amaan
    October 21st, 2012 at 12:29 | #6

    What nonsense there is no file for Windows XP 32 bits

  7. November 4th, 2012 at 12:02 | #7

    i want to have that talking cat version 3 through android..

  8. November 4th, 2012 at 12:07 | #8
  9. purushotam
    April 18th, 2013 at 14:00 | #9

    when i installd android sdk on windows,an error is displyed as “Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml, reason: dl-ssl.google.com”..so please clarify why i am getting this error on my pc

  10. April 18th, 2013 at 17:13 | #10

    @purushotam
    It may be a transient error. Can you try again and/or download this file in your web browser?

  1. March 27th, 2012 at 20:07 | #1
  2. December 17th, 2012 at 10:32 | #2