CNX Software – Embedded Systems News

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:

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:

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):


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.

That’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.

Support CNX Software - Donate via PayPal, become a Patron on Patreon, or buy review samples