Getting ready for Android development

In: Android

27 Oct 2009

Here are the steps I took to get my Android development environment set up on my Windows 7 64-bit box.

  • Download and install Java Development Kit SE: JDK 6 Update 16.
    File name I ended up downloading was jdk-6u16-windows-x64.
  • Download and unpack Eclipse IDE for Java Developers.
    File name I ended up downloading was eclipse-SDK-3.5.1-win32-x86_64.zip.
  • Download and unpack Android SDK.
    File name I ended up downloading was android-sdk_r3-windows.zip.
  • Changed android.bat inside Android SDK according to this tip.
  • Start a command prompt as administrator and run the following command from the tools folder of the Android SDK:
    android update sdk
  • Fixed error “Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml, reason: HTTPS SSL error. You might want to force download through HTTP in the settings.” by doing as it says and then clicking Update all button under Installed packages. Not sure why this was needed because the https link loaded fine in my browser.
  • Select “SDK Platform Android 1.5″, Accept and then Install Accepted. Actually I ended up downloading all platforms (not sure why, but I have room so what the heck). This means 1.1, 1.5, 1.6, 2.0, documentation
  • Start Eclipse and accept the default workspace location (or change – it is just the place to put your projects and files). Choose Help, Install new software. Input the following link and click Add button.

    https://dl-ssl.google.com/android/eclipse/

    Type a name for the link/source and ok. Check “Developer Tools” once it appears in the list and click Next, Next, I Accept and Finish. I got a warning about unsigned content, but accepted with OK. Also, a Yes for restarting Eclipse.

  • Choose Window, Preferences inside Eclipse. Under Android, Browse for the location where you unpacked the Android SDK. I clicked Apply, but it seemed to take a while and maybe another click and/or another Browse attempt before the list filled up with my targets “Android 1.1″, “Android 1.5″ etc. OK.
  • Choose Window, Android SDK and AVD Manager inside Eclipse. Click New under Virtual Devices. Type a name for your phone emulator and select your target platform, Android 1.5 for me. Type a size for your emulated SD card, I chose 200 MiB. I did not create any additional hardware abstractions (yet, will probably come back later). Then Create AVD and close the dialog box.
  • Choose File, New, Project inside Eclipse. Select Android Project and Next. Type a name for your project and select your target platform. I’m going for Android 1.5 which is on my HTC Hero at the time of this writing. Also input values for the following fields, for example:
    Application name: My App
    Package name: com.mycompany.myapp
    Create Activity: MainActivity
    And complete with a click on Finish. Now, you may think nothing has happed, but it has. Just click icon on right which saids “Workbench” when you hover on it. There you have your project and source files to work with!
  • Click Debug button in toolbar in order to test the application in the emulator. Select Android Application and off you go. Even on my Intel Core i7 processor it takes some time to get the app running inside the emulator, about 1 minute! Note however, that if you keep the emulator running, it only takes about 5 seconds to launch a new version of my application from within Eclipse.

That’s it. Now off for some educational reading in how to write Android applications. I hope to get back on that matter.

41 Responses to Getting ready for Android development

Avatar

Keyston

November 14th, 2009 at 21:36

Thanks for this , just got a driod and about to dive into developing a small app

Avatar

Marry

November 30th, 2009 at 11:40

Thanks for giving details explanation about how to configure Android platforms.

I was struggling for 3 weeks to get target option in New Project Create dialog.. now i created a new project without any problem.

Thank you for your guidance .

~Marry

Avatar

srpanpaliya

December 6th, 2009 at 02:11

Thanks for the detail documentation. It has saved my lots of time.

Avatar

Billy Scholtz

December 9th, 2009 at 18:24

You are brilliant. Where are you based?

Avatar

admin

December 9th, 2009 at 19:09

Thank you (all!). I’m just glad to help. I’m in Sweden.

Avatar

dan

December 31st, 2009 at 21:56

Was stuck on the SSL error, this helped me figure it out. Thank you!

Avatar

tony

January 8th, 2010 at 00:14

Thanks so much. Just in case anyone runs into my problem – I got an error when creating new project – about gen files. Click Project->Clean and everything runs fine. No idea what caused the error.

Avatar

Aqeel

January 13th, 2010 at 01:36

thanks buddy.it was very helpful.

Avatar

libcues

February 9th, 2010 at 07:10

mr. plate – greetings—I am starting prepare the makeshift hideaway where i will make my best attempt at a very unique app. I messed around with the source code a few months back and (thats how I learn, by messing around without proper instruction) and I have this question — I enjoyed your rundown and its on the wall, but what changes do you know about that may have occured between october 2009 and now? Any items I should read up on? I’m sure I’ll find out eventually, the easy way, or the hard way (but does it have to be the hard way?)

cheers and to the readers — i hope you had an astonishing time with that code and are enjoying your successes!

Avatar

Balu

February 11th, 2010 at 03:52

Great article.I am getting some errors initially but this article and comments solved my problem. Thanks

Avatar

Toni

February 22nd, 2010 at 11:47

Thanks a lot. It was very helpful for me.

-Toni

Avatar

Paul

March 28th, 2010 at 14:21

Thanks man! I was also stucked on ssl error.

Avatar

Stella

April 6th, 2010 at 00:31

Thank you for this post. Your documentation is better than Google’s.

Avatar

Jomy

April 12th, 2010 at 14:01

I’ve downloaded the Android SDK and when i unzipped it and clicked on SDK.exe, i’ma gettting an error.
Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml, reason: dl-ssl.google.com

Could you please let me know what needs to be done here?

I tried some tips and tricks but it didnt worked

Thanks & regards,
Jomy

Avatar

admin

April 12th, 2010 at 20:26

Just change https to http in the address and retry in the dialog box with the error. Hopefully that is sufficient.

Avatar

Apu

April 27th, 2010 at 18:55

I am getting the following, with or without HTTPS

Failed to fetch URL http://dl-ssl.google.com/android/repository/repository.xml, reason: dl-ssl.google.com

The link works fine in my browser. What do I need to do?

Avatar

Akhlaq

May 8th, 2010 at 12:29

hello there

I am unable to select target platform it is just showing nothing.

please help me…

Avatar

Show screen dump of dialog box in Eclipse

May 8th, 2010 at 16:57

@Akhlaq It sounds as though you haven’t set up the path to the Android SDK correctly. Assuming you have downloaded and unpacked the Android SDK to a folder on your computer, you need to specify that folder in Eclipse under Window, Preferences, Android. (Click the title of this comment for a screen dump of that dialog box on my computer.)

Avatar

paul

May 18th, 2010 at 04:45

“tack” -Paul from Dallas.

Avatar

Shivam

May 26th, 2010 at 08:02

I am getting the following, with or without HTTPS

Failed to fetch URL http://dl-ssl.google.com/android/repository/repository.xml, reason: dl-ssl.google.com

The link works fine in my browser. What do I need to do?

Avatar

admin

May 26th, 2010 at 09:48

@Shivam Can you start “SDK Setup.exe” in the Android SDK folder and under Settings check “Force https:// to http://” and see if that helps? Screenshot of dialog box here:

http://twitpic.com/1r63ze

Avatar

Ramesh

May 29th, 2010 at 08:06

Im getting the same failed to fetch URL error wont work even with the force http option or even adding another source with https corrected to http in sources. I added it to allowed program on windows and mcafee firewalls.
Please help.
Thanks a lot.
Ramesh

Avatar

Ramesh

May 29th, 2010 at 09:24

Hi Mike,
I think i fixed it.
I ran the following command from the command prompt.
tools\android.bat update sdk
It launches the same old sdk but it worked somehow.
Ramesh

Avatar

Tyrone Scott

June 6th, 2010 at 20:09

I need help getting what I need to download so I can try and make applications. I have Windows Vista 32bit Service pack 2, someone help !!!

Avatar

Alice

June 17th, 2010 at 14:32

I have an error when trying to create a new AVD.
I get this in the console dialogue thing every time I click create AVD

[2010-06-17 13:28:16 - SDK Manager] could not create file ‘C:\Users\Alice\.android\avd\emulator.avd\sdcard.img’, aborting…
[2010-06-17 13:28:16 - SDK Manager] could not write to ‘C:\Users\Alice\.android\avd\emulator.avd\sdcard.img’, aborting…
[2010-06-17 13:28:16 - SDK Manager] Failed to create the SD card.

Thanks if anybody could help.. :)

Avatar

Simon Slater

June 19th, 2010 at 23:15

I have the same issue as Alice. When I try to create a new AVD I get the same error, which is Failed to Create SD card.

I also have another problem. When I try to open my simple hello world app in the emulator I get a bus error. Example:

* I launch the emulator from an avd with no sd card size settings.

* then I install .apk file to the emulator. When I do I get a bus error.

I think this is because I cannot create an emulator with a proper SD card setting. Am I right? Or is this another issue I need to deal with? Of course, any assistance is much appreciated.

Avatar

admin

June 20th, 2010 at 20:43

@Alice @Simon Just a few things that you probably have tried already, but just to be clear: Does the path mentioned in log exist? Can you manually create a text file or whatever in that directory? (in “…\emulator.avd\”). How large is the specified size of the sdcard file (enough empty room on hard drive)? Do you have any Anti Virus software that may block writing the file installed/running? (turn off and test!)

Other than that, I think an advanced tool like Process Monitor for Windows would be my last resort in order to find out what the failing system call might be and the error code. But you’d have to know a lot about file system calls in Windows in order to get something out of such a log, and it might not lead you any closer anyhow.

Avatar

Brian Kriesel

June 23rd, 2010 at 05:25

Thank you for the very useful article.

Avatar

ldso

June 23rd, 2010 at 22:58

Hey folks, I ran into the same problem using the graphical AVD tool. I thought it must be just because I use a Mac, but apparently not so!

I had to fix it by running the android executable by hand. For me it was:
android list targets
This showed me which api versions that I could choose for my avd:
HP-J5780:~ ldso$ /Applications/android-sdk-mac_86/tools/android list targets
Available Android targets:
id: 1 or “android-3″
Name: Android 1.5
Type: Platform
API level: 3
Revision: 4
Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
id: 2 or “Google Inc.:Google APIs:3″
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 3
Description: Android + Google APIs
Based on Android 1.5 (API level 3)
Libraries:
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: HVGA (default), HVGA-L, QVGA-P, HVGA-P, QVGA-L

… and so on. Using that info, I created an avd named eris2 with a target id of 3(for Android 2.1):
HP-J5780:~ ldso$ /Applications/android-sdk-mac_86/tools/android create avd -n eris2 -t 3
Android 2.1-update1 is a basic Android platform.
Do you wish to create a custom hardware profile [no]
Created AVD ‘eris2′ based on Android 2.1-update1,
with the following hardware config:
hw.lcd.density=160

I hope that that is very helpful! I found the answer somewhere before. ldso

Avatar

Troy

July 12th, 2010 at 08:48

Ill add my thanks to the choir… saved me LOTS of work figuring all that out myself! :)

Avatar

Guru

July 15th, 2010 at 08:22

Hi Mike,
Thanks a ton for the instructions. They worked like a charm. I am eagerly waiting for your links on how to develop applications.

Thanks,
Guru

Avatar

Lets us peek at your Screens! - Page 30 - Android Forums

July 17th, 2010 at 09:51

[...] Originally Posted by darthstorm528 I kept getting this when running the SDK "Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml, reason: HTTPS SSL error. You might want to force download through HTTP in the settings." ilove google chances are someone has had the problem b4 you, try the solutions in this thread… Getting ready for Android development – Mike Plate [...]

Avatar

Frank D

July 22nd, 2010 at 01:01

AWESOME ARTICLE dude.. thank you very much.. haven’t programmed in years .. different versions of Basic.. did some HTLM for a bit.. but wanna learn this stuff.. excellent on making it easier for me to get this up and running without being frustrated !!!

Avatar

Mufeeda

July 30th, 2010 at 05:30

Thanks Mike.Great help…..:)

Avatar

bugmenot

August 4th, 2010 at 14:08

hello mike,
can i download the android 2.2 plattform. i didnt find anything do dl the plattform. i dont have internet on work so i have to install it manually.

ty and cya

Avatar

admin

August 4th, 2010 at 22:18

@bugmenot Yes. After unzipping the Android SDK and then running “SDK Setup.exe”, the Android 2.2 platform should be one of the options. All platform version specific files are downloaded from the “SDK Setup.exe” utility (not by finding any files in your browser). If you are saying that you have to download from another computer than the one you will do your development on, I’m not sure exactly what has to be done. From your downloaded installation, you should be able to copy the folder ../platforms/android-8 to your other development machine to get the Android 2.2 platform files, but I suspect you might have to reference this in some more places in order to have it show up in Eclipse etc. Unfortunately I don’t know anything about the specifics.

Avatar

Massive Problem! - Android Forums

August 7th, 2010 at 07:14

[...] rig, and after some patience, and forum digging, was able to get my phone and pc to cooperate. Getting ready for Android development – Mike Plate helped me alot. I am on my first rooted android, and found this information fairly [...]

Avatar

ziyenge

August 15th, 2010 at 21:17

Greetings.

Do I have to create a Java application before entering details such as

Application name: My App
Package name: com.mycompany.myapp
Create Activity: MainActivity

No icon on the right displays ‘Workbench’.

I get an error message saying ’2 errors, 0 warnings’.

The errors say ‘Build path Build Path Problem’

Avatar

Larry

August 16th, 2010 at 04:19

Thanks Mike…this was a good article…I have setup the Android eclipse plugin and added my first project using the android wizard…running it displayed the emulator…didn’t have any problems with the install and setup but it was nice having this page to refer to if I did…thx man…

Avatar

Se7s

August 21st, 2010 at 18:50

Hi,

I have downloaded the SDK R6 some time ago and now when I try to update to load the android platforms I get the following error:
“Failed to fetch URL http://dl-ssl.google.com/android/repository/repository.xml, reason: Software caused connection abort: recv failed ”

I have tried re-installing and it doesn’t work, any ideas?

Thanks,

Se7s

Avatar

Se7s

August 21st, 2010 at 19:08

Hi ,

Quick update, I found out my ISP was for some reason blocking the urls to the update !! When I used my 3G connection I was able to update correctly

Cheers,

Se7s

Comment Form

About this site

I'm a freelance web and mobile developer that likes to share whatever experiences I might encounter. It used to be .NET related, and still is to large extent, but I'm also a struggling agnostic trying out interesting technologies from the big three - Microsoft, Google, Apple - and the open source world.

  • admin: @Ed M: Thank you for your support. You are right about the phrasing. I'm describing what I'm doing i [...]
  • Ed M: Ah, the "code" tag didn't work in my comment as it did in yours. Let's try again, substituting long [...]
  • Ed M: Thanks so much, Mike. Actually, before I came back here I was experimenting on my own, and I figured [...]
  • admin: @Ed M: Sure, I've thought about it and might add a button that generates complete html that can be c [...]
  • Ed M: This is a great tool and I'd be glad to donate, but sorry, can you give us some clearer and more spe [...]