Saturday, January 23, 2010

How to Setup Android Development Environment

There are many ways to develop for Android and because of all the options it is sometimes a little daunting getting your environment setup. I found myself bouncing from web page to web page, not really sure if I had the right tools and if they were setup correctly. I wanted to document the process that worked for me.

Goal: Step by step instructions to install and configure your Android development environment for Windows.

Environment/tools: Here is the setup I have chosen to use.
  • Windows (I'm using Windows 7, but any flavor of windows will do)
  • Eclipse IDE for Java Developers (v3.5 Galileo)
  • Java Platform (JDK 6 Update 18)
  • Android SDK Tools, Revision 4
 Step 1. Install Eclipse IDE
I chose to use the Eclipse IDE for Java Developers (v3.5 Galileo). You can download the it here
  • This is a zip file and does not require installation. Just copy the eclipse folder into your programs directory
Step 2:  Install Java Platform (JDK 6 Update 18)
  • Select your platform

  • Now run the JDK installation. I did not change any of the default installation options. When complete continue to step 3.


Step 3: Download the Android SDK Tools, Revision 4

  • This does not require installation. Just unzip and copy the files. You can install the package anywhere but remember where you put as you will need to reference it in Eclipse. I happen to install it inside my eclipse folder.

Step 4:  Configure Android SDK


  • Launch "SDK-Setup.exe" located in the Android SDK install folder"
  • If you receive the following "Failed to fetch url https://dl-ssl.google.com/android/repository/repository.xml" we need to change the URL to not use SSL. Close the error dialog.
  • Press "Cancel" on the "Choose Packages to Install" Dialog
  • Select "Settings" in the left pane
  • Check "Force https://... sources to be fetched using http://"
  • Press "Save and Apply"
  • Select "Available Packages" in the left pane
  • Select "Documentation" (at the top of the list)
  • Select "Usb Driver Package, rev 3 (at the bottom of the list)
  • And then select any platform you want to develop. You can select all (be prepared for a long download) or you can select only the platfrom for you phone. The Nexus One uses 2.1 and the Droid for Verizon uses 2.0.1.
  • Check "Accept All" and Press "Install Accepted"

  • When done press "Close"
  • Now we are going to create a virtual device (AVD)
  • Select "Virtual Devices" in the left pane
  • Select "New..."
  •  Create the following new Android Virtual Device
    • Name: Android2.1
    • Target: Android 2.1 API Level 7 (Or which ever API you installed)
    • SD card Size: 4000 MiB to 32000MiB (16000 MiB shown)
    • Leave the rest at the default settings

  • Press "Create AVD". Be patient it may take a few minutes to create your new AVD.
  • Close the SDK setup. 
Step 5:  Configure Eclipse
(These instructions are for Galileo version of Eclipse. Please see this page for instructions if you downloaded the Ganymede version of Eclipse)

  • Launch Eclipse for the first time. You will be asked where you want to your workspace folder to be located. 
    • I used the default location. 
    • Check "Use this as the default and do not ask again" so you don't have to answer this question every time.
    • Press "OK".

  • Select "Help > Install New Software..."
  •  Press "Add..."
  • Fill out the Add Site information
    • Name: Android
    • Location: https://dl-ssl.google.com/android/eclipse/
    • Press "OK"
 If you get an error don't use SSL. change location from "https://dl-ssl.google.com/android/eclipse/" to "http://dl-ssl.google.com/android/eclipse/"
  •  After a connection is made and available tools are retrieved expand "Developer Tools" and select "Android DDMS" and "Android Development Tools"
  • Press "Next"
  • Press "Next" again.
  • Check "I accept the terms of the license agreements"
  • You may receive a Security Warning about unsigned content. Press "OK"
  • Done. Now you should restart Eclipse.
  • After rebooting we need to tell Eclipse where we copied the "Android SDK" in step 3.
  • Select "Windows > Preferences"
  • Select "Android" from the left pane. After you select "Android" you will receive an error. That is because it is not setup yet. We are setting it up now.
  • For the SDK Location, browse to where you installed the SDK.
  • Press "OK"
  • A dialog box will appear. If you want to send usage data to Google leave it checked, other uncheck it and press "Continue". This dialog box can sometimes get trapped beneath your window. Minimize Eclipse if you don't see it.

 You are now ready to build your first application. To create a "Hello World" app check out my post here. If you have any questions feel free to post a comment and I will do my best to answer.

    79 comments:

    SM411 said...

    What a great tutorial! I didnt figure out how and where to get the software, and at least not how to set it up properly! Thanks for the great work man!

    Clifford Campbell said...

    Awesome guide, very detailed.

    Carl F said...

    Very nice! I'm all setup now and ready for "Hello World" tomorrow. Thanks!

    Shravanthi said...

    Great article Greg!!

    The set up was quick and now am all set to kick start android dev...


    Thanks,
    Shravanthi Denthumdas

    Anonymous said...

    I am always so impressed when someone takes the time to help others. Thank you for the great work!

    Unknown said...

    I just came over from the xda forum you posted, I appreciate your work man. I thank you for helping me out boss! Hopefully you don't get annoyed by some of my questions from time to time. I like to do things right from the begining and it seems I'm finding the right path. Between CyanogenMod, RA's image and now you, I think I'm going to achieve what I want out of this. Thank you.

    Corbin said...

    bit of an older post now, but thanks quite a bit for this. truly a big help to us aspiring droid developers.

    Anonymous said...

    Thanks

    Anonymous said...

    Woh Very Very Nice Tutorial very help ful thx alot...

    Anonymous said...

    Voila
    Thanks a lot man.

    Unknown said...

    hello All.... M Sylvia Gilbert working with Android Application Development and i would like to say that this post is very useful & informative. Thanks....

    Anonymous said...

    Very nice job, I was wondering how to get started and found one of your posts on a programming forum. I don't have a phone yet, because I am not sure I can afford the monthly bill! But I love to program and for now I will just try and get up to speed with it all.

    Thanks,
    Rob

    Unknown said...

    Hi
    I am using Eclipse Galileo 3.4 and getting Perm gen space error even though I have increased the memory size to 512MB.

    eclipse.buildId=I20090611-1540
    java.version=1.6.0_05
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
    Command-line arguments: -os win32 -ws win32 -arch x86
    Pl advise me what is to be fixed.
    TIA
    Rajiv

    Anonymous said...

    you rock!!!!!!!!!!!!!!!!!!!

    Anonymous said...

    Fantastic - thanks for the info. I want to start developing for Android and did not have a clue. Well done!

    Android Developer said...

    The tutorial is really very nice and informative , it gives detail information for every process of installing android development environment for windows in mobile phones. You have used exact pictures for demonstration. I haven't used this manual yet but really looking forward for this for sure... thanks.

    Unknown said...

    Hi
    I have found this article very helpful for me. Thanks buddy for posting it and helping people like me. Images are great to explain,,,,

    Manu said...

    The blog is really nice one and full of information we appreciate the kind of information you have provided in this post. The information are so useful for all of us and we would like to thank you from the bottom of our heart for this wonderful information.The things you have discussed about in this post which are supposed to be very helpful for us. Because of these wonderful information in this post the blog can be viewed again and again.

    Vaibhav Uchil said...

    Thank you Greg, Great Tutorial. I can think of N places where i could have gone wrong.. This helped

    Anonymous said...

    Awesome! Thanks!
    (Note: maybe add specifically that the eclipse zip needs to be extracted in step 1)

    Anonymous said...

    Great job! Probably saved days (or maybe weeks) or work. None of this shows up in Add/Remove Programs so how can this entire enviroment be removed if I want to at some point?

    Anonymous said...

    without this guide i would've been screwed thanks man

    Sid said...

    Very nice tutorial Mate..

    Anonymous said...

    i am getting the error, failed to create SDCard :s please help.

    Mr. D said...

    hey tell me for eclipse helios plz...

    Anonymous said...

    awesomem yar.....:)

    Gopal said...

    While creating the AVD I am getting some SD card error. How to clear that.

    Gopal said...

    I reduced the SD card size to 4000 and it created that is because my C:\ drive has only 8GB free space, so I reduced the SD card 16000 to 4000 and it successfully create.

    Pearlson said...

    Thanks a lot dude....
    this was really helpful
    from - Massmasti

    MiltonChapman said...

    EXCELLENT !!!! VERY EASY TO UNDERSTAND WITH SCREENSHOTS !!!!

    Anonymous said...

    thanks.... great work

    Anonymous said...

    Thanks for the grate work!!!!

    Anonymous said...

    hello integration with eclipse and android is good. but I want monkey test to my project how can i do pls give steps starting to end .

    Anonymous said...

    Hey, very helpful steps. I noticed that you put android sdk into the eclipse directory. Is it correct ?

    Anonymous said...

    I'm a student from UK. This is a really nice tutorial for beginners in Android and eclipse. Thank you very much.

    Anonymous said...

    Thank you so much. I've been struggling to figure out how to run android, your tutorial helped me through it with ease :)

    Tess said...

    Thank you so, so SO much. You have no idea how much help this was!

    MoMo said...

    Hi,
    Thank you so much.
    But I have many problems with that.
    If you are still checking this site, I want to ask you a very long question.
    So, please let me know if I can ask you questions.

    Anonymous said...

    Really useful..
    Thanx lot.

    Anonymous said...

    great work dood !

    Anonymous said...

    Great Article... Excellent work. Thanks a ton dude.. U made my day n life too.. :) Keep going...

    Brian said...

    I have been looking for something like this for a while. Definitely going to bookmark this page. Perhaps you could include something about installing an SVN plug-in for eclipse?

    andrid said...

    superrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr

    Brijesh Dutta said...

    super Like ...Cheers ..!!!!!!!!!1

    Anonymous said...

    Great thanks

    Anonymous said...

    Still helping people 2 years on. Thank you.

    Anonymous said...

    Yes! Finally!! I found the most detailed guide! Phew... Thanks for this dude!

    kashif said...

    Loads of Thanks Bro. Really helpful and detailed. Thanks Again.

    Unknown said...
    This comment has been removed by the author.
    Unknown said...

    pls tel me netduino board is enough for porting android or arm9 i should use pls tell me the hardware description wat i should use and hardware codings n jus layout the procedure to get the final output..

    Unknown said...

    pls tel me netduino board is enough for porting android or arm9 i should use pls tell me the hardware description wat i should use and hardware codings n jus layout the procedure to get the final output..

    Anonymous said...

    which is the latest version of android sdk
    tell link of latest sdk zip file
    can we use the latest sdk
    mail me @ htcexplorersgnr@gmail.com

    Anonymous said...

    So many thanks..
    very very useful... simple and very clear

    Keep up the good work :)

    Anonymous said...

    Thank you so much for this great tutorial!

    Anonymous said...

    Follow the instructions and just download the newest SDK (I downloaded the whole bundle) and placed that unzipped folder in the eclipse folder. Than at the point where you add the reference you just point to the new SDK folder, no problem.

    Unknown said...

    Please check it:Most easy way to set up android environment

    http://computerexclusive.blogspot.com/2013/11/android-development-environment-setup_17.html

    Unknown said...

    Congratulations guys, quality information you have given!!!..Its really useful blog. Thanks for sharing this useful information..

    J2EE Training in Chennai

    JAVA Training in Chennai said...

    Thanks for your article for setting up Java environment. It helped me a lot while installing Java on my computer.

    JAVA Training in Chennai said...

    Thanks for your article for setting up Java environment. It helped me a lot while installing Java on my computer.

    Unknown said...


    Your posts is really helpful for me.Thanks for your wonderful post. I am very happy to read your post.

    Android Training in chennai | Android Training chennai | Android course in chennai | Android course chennai

    Unknown said...

    very nice blogs!!! i have to learning for lot of information for this sites...Sharing for wonderful information.

    Joomla Training in chennai | Joomla Training chennai

    Unknown said...

    Screen shots are very helpful to understand. keep it up

    Android Application Development in chennai

    Kannan R said...

    Great Job ! Everything explained very clearly. Thanks for sharing.

    Android app development

    Unknown said...

    There are lots of information about latest technology and how to get trained in them, like Hadoop Training Chennai have spread around the web, butthis is a unique one according to me. The strategy you have updated here will make me to get trained in futuretechnologies(Hadoop Training in Chennai). By the wayyou are running a great blog. Thanks for sharing this (Salesforce course in chennai).

    Unknown said...

    Nice post. For the Android Apps Development please consult with Megron Tech is the best android apps development company in Sweden, UK.

    Melisa said...

    Thanks for sharing this pretty post to our knowledge, SAS is a program that assists to retrieve, managing and uploading the data & simply it’s an integration system of software for performing these actions, thanks for taking your time to discuss about this topic.
    Regards,
    sas training in Chennai|sas course in Chennai|sas training institute in Chennai

    Unknown said...

    To keep ourselves up to date with the current trend is not an easy task in IT. But we can, through quality and worth able content like this. Thanks for sharing this web page. Please write more articles like this in future.

    Hadoop Course in Chennai
    | Hadoop training institutes in chennai | Manual testing training in Chennai

    Unknown said...

    How is this webnet organization? My one companion let me know this is absolute best and reasonable custom android app development organization in karachi. http://webnet.com.pk/

    Unknown said...

    Good Information..Pls visit us:enterprise solutions

    Reeta said...

    Yes, you are absolutely correct...And it is very informative and very clear and easy to understand.. seo training in chennai

    1croreprojects said...

    be projects in chennai

    ieee java projects in chennai

    ieee dotnet projects in chennai

    ns2 projects in chennai

    bulk projects in chennai

    IT Tutorials said...

    It is really a great work and the way in which u r sharing the knowledge is excellent.
    Thanks for helping me to understand basic concepts. As a beginner in android programming your post help me a lot.Thanks for your informative article. Android Training in velachery | Android Training institute in chennai

    Sujitkumar said...

    nice explanation andriod coding. very useful information for learn andriod. i want to get some more andriod tutorials. keep sharing on Andriod tutorials.
    Thank you

    Unknown said...

    Very Nice Blog I like the way you explained these things.
    Indias Fastest Local Search Engine
    CALL360
    Indias Leading Local Business Directory

    Aptron said...

    Nice post!! Thanks for sharing.

    Android Training Institute in Delhi
    Network Training Company in Delhi
    Software Testing Training In Delhi

    Unknown said...

    Thanks! your Post explaining everything related to this blog deeply. such a valuable post. keep it up.

    Best Hadoop Training in Gwalior | Best Big Data Training in Gwalior | Best CCNA Training in Gwalior

    Karthika Shree said...

    This is extremely great information for these blog!! And Very good work. It is very interesting to learn from to easy understood. Thank you for giving information. Please let us know and more information get post to link.
    SAS Training in Chennai

    Unknown said...


    Nice it seems to be good post... It will get readers engagement on the article since readers engagement plays an vital role in every blog.i am expecting more updated posts from your hands.
    iOS App Development Company
    iOS App Development Company

    Freddi King said...

    Thank you for taking the time and sharing this information with us. It was indeed very helpful and insightful while being straight forward and to the point.
    mc donalds gutscheine | startlr | salud limpia

    Post a Comment

    Note: Only a member of this blog may post a comment.