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.
- Download and install Java SDK.
- Download and unzip Android SDK.
- Run “SDK Manager” from Android SDK to download the platform versions.
- Download and unzip Eclipse.
- 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:
Download and install Java SDK
You’ll find the Java SDK here:
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:
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)
- SDK Platform Android 2.2, API 8, revision 2
- SDK Platform Android 2.1, API 7, revision 2
- Samples for SDK API 8, revision 1
- Google APIs by Google Inc., Android API 8, revision 2
- Google APIs by Google Inc., Android API 7, revision 1
- Usb Driver package, revision 3
- Market Licensing package, revision 1
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:
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:
- Select Help menu
- Install new software
- Type any Name, like “Android”
- Paste this address in Location: https://dl-ssl.google.com/android/eclipse/
- After a few seconds, the list should contain “Developer Tools” and there you’ll find “Android DDMS” and “Android Development Tools”.
- Select both and then Next
- 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:
- Select Window menu
- Click Browse button next to “SDK Location”
- 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)
- After a few seconds the list should fill with the Android platforms you chose to download with “SDK Manager” previously
Create your first Android project
Now you should be able to create your first Android project. Still in Eclipse:
- Select File menu
- Android, Android Project
- Project name: My first project
- Build Target, Target Name: check any platform version you’d like to start with
- Application name: MyFirstProject
- Package name: com.myname.MyFirstProject
- Create Activity: (checked) MainActivity
- Min SDK Version: (can be left empty)
- 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.