Getting Started with Android

Ever since I purchased my HTC Desire in April 2010, I wanted to know more about how it did, well, what it did. I knew it was Java, but I didn’t know how it all came about. This article is for absolute beginners of the highest order so please don’t expect to come out the other side being a superstar.

What You’ll Need

  • Android Device
  • Computer, Mac OS X or Windows
  • Internet Connection
  • Patience

What You’ll Learn

  • Installing the Android SDK
  • Installing the Eclipse Java IDE
  • Configuring Eclipse and the SDK working together
  • Configuring your Android for development
  • How to take screenshots with ease
  • Where to from here?

Installing the SDK

Download the Android SDK from the Developers Website. When you’ve installed/extracted it remember where you put it.

Installing the Platform Tools

Open the folder where you installed the SDK, then go into the Tools folder and open Android. This will open the AVD Manager. Click on Available Packages, then choose either the entire repository, or get specific and simply select the SDK Platform Tools. If you install everything, this is where you need the patience, because it takes a while to download and install the entire repository.

Installing the Eclipse IDE

There are few choices in IDE, the most popular is Eclipse. You can download it from Eclipse. Google recommends Eclipse Classic, but either Eclipse for Java or Eclipse for RCP and RAP developers will work. Note that I have personally chosen the Java install.

Configuring Eclipse to work with the SDK

This needs to be followed quite closely, as it’s easy to go the wrong way. It also requires patience, because there’s a decent amount that you need to download. When downloaded, extract Eclipse and open the Eclipse application from that directory. Nominate where you want your workspace to be, personally, I just ran with the default.

Now we need the ADT Plugin for Eclipse. In Eclipse, go to Help » Install New Software. Put in “https://dl-ssl.google.com/android/eclipse/” and name it something obvious like ADT.

Once done, select Developer Tools and hit next. It will confirm the four items to be installed, DDMS (Dalvik Debug Monitor Service), Dev Tools, Hierarchy Viewer and Traceview. Hit Next, accept the license terms then Finish. When it’s done you’ll need to restart Eclipse.

The final step is pointing Eclipse to the Android SDK. Go into the Eclipse Preferences, ⌘, on OS X or Window » Preferences otherwise, Select Android on the left then browse to the SDK Folder.

Configuring your Android for Development

The easiest part. Go into Settings » Applications and check the USB Debugging box.

How to Take a Screenshot

Unline the iPhone where you just press two buttons, taking a screenshot on your Android is a lot more of a pain, and perhaps one of the reasons people go to the above lengths. Of course, you can always Root your device, but we will cover this later

Buried in the depths of where you installed the SDK in android-sdk-*/tools/ you’ll find an app named DDMS. From the Device menu choose Screen Capture. Save it. That’s it. It’s a lot of work to take a screenshot. I personally recommend rooting your phone and getting an app to do it.

Where to from here?

If you’ve made your way through the guide and want more, there are other ways to keep learning. Keeping checking in here on BuildMobile, follow us on Twitter, or Facebook, or subscribe to one of our RSS feeds. Or all of the above if that’s your cup of tea.

Buy a book. There’s a lot of great Android Development books available and printed material is a fantastic way to supplement online learning.

Get involved in the online communities

There’s a lot of Developer Groups that are probably operating near or in your area, so definitely consider going to an occasion. The people that regularly attend and organize these live and breathe their technology of choice. You’ll be able to make friends and learn a lot, and maybe even find a mentor.

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

  • http://www.bestandroidmobilephone.com Scott

    Hi Aaron –

    First, let me say “kudos” for writing something that assumes the user has little or no knowledge of the subject. I had a question about the development repository. Is it better (as a beginner) to download the entire repository (even with the extra time) or just portions?

    Hope to see more tutorials soon.

    Thanks, Scott

    • Aaron Osteraas

      Hi Scott, really happy to hear you enjoyed it.

      Regarding the repositories, it depends what you’re trying to achieve. I recommend getting all that apply for what versions of Android OS you want to make an app for. In any case, there’s no harm in downloading more than you need.

      Cheers

  • Pingback: BuildMobile: Getting Started with Android » SitePoint

  • Rex

    The “Feedback” Button in this Article is irritating and intrusive, that is against good web design!!!

    • Aaron Osteraas

      Rex, what device/browser are you using?

      • Efe

        Hi,
        I also noticed the feedback button, I use Chrome (whatever final version it is now), the feedback button is right over the article if the windows is not full width (on 13.3″ screen).

  • http://android-elements.blogspot.com/ AndroidElements

    Great guide to getting and installing the Android SDK. It’s quite time-consuming to do and also not the sort of thing you go back to after you have a working environment (I find it easier to copy Eclipse folder than reinstall) – so good effort.

    Also, as Rex mentioned, the Feedback tab thing on the left obscures the text when you’re reading the article (Chrome 12 on Win 7)

  • redwolfe

    Great article! However, as a total newcomer to Java, I can’t install the Android SDK because I don’t have the Java JDK. The install throws up an error message and refuses to proceed.

    The error message supplies a link for downloading the Java JDK, which I followed and installed the latest version – version 7. Ran Android SDK install again. Same error message. Rebooted. Same. Ran JDK install again – it claims that the JDK is already installed.

    After reading more info on the Android SDK site I think I actually need an older version of the JDK – version 5 or 6. I’m now downloading version 6.

    I have a lot of development experience so I’ll be able to figure this out. Thought you might want to give some pointers on this in your article to total newbies. Like me, they are unlikely to have the JDK installed. If they have little programming experience, they may give up when installing the latest version of the JDK doesn’t work.

    (I’m running Win7 64-bit btw).

  • redwolfe

    Re my previous post. The solution can be found here:

    http://stackoverflow.com/questions/4382178/android-sdk-installation-doesnt-find-jdk

    Like a poster on that page, I wasted a couple of hours on this bug. I’m proceeding with JDK version 6 as I uninstalled 7. Don’t know if version 7 would have worked.

  • redwolfe

    Me again. Having installed the Android SDK, I encountered a new problem with the ‘Android SDK and AVD Manager’. It wouldn’t download anything as it perceived the install directory as being read-only. A simple permissions change didn’t solve this.

    The solution is here: http://code.google.com/p/android/issues/detail?id=16154
    and here: http://www.sevenforums.com/tutorials/316-compatibility-mode.html.

    The file on which compatility should be changed is SDK Manager.exe. At least, I did this and it now seems to be downloading files, which it wasn’t doing before.

  • redwolfe

    Hi Aaron,

    At risk of becoming irritating, I have an update on my install process. I thought you might like to know that Eclipse Classic is a disastrous choice for Android development. Trying to be virtuous, I installed it instead of the Java version.

    When I followed your instructions for adding the ADT Plugin, I got error messages indicating that required prerequisites were missing. Trawling through Google I found install locations for some of them, then finally followed the advice supplied here: http://stackoverflow.com/questions/3809866/help-setting-up-eclipse

    Which was, to scrap Eclipse Classic and install the Java version instead.

    Could be useful advice, particularly for newbies. Java old hands would probably take all this in their stride.

  • chong

    Awesome tut! You are the man!
    Thanks for showing me the way…

  • John Ghormley

    I find it somewhat ironic that the Android is based on Linux or a ‘nix type OS and the SDK will not run on Linux but rather on a Windows or BSD(Mac) system. One must see the strangeness despite the overwhelming numbers of users who drink the Microsoft Kool-Aid. I use an Android because I am a Linux user. Is there no natural connection there?