Over a million developers have joined DZone.

Getting Started with Android development using Eclipse

· Java Zone

Easily build powerful user management, authentication, and authorization into your web and mobile applications. Download this Forrester report on the new landscape of Customer Identity and Access Management, brought to you in partnership with Stormpath.

Finally I found time to start looking at Android development. In the past I have been developing mobile applications on Java ME, Windows Mobile and Windows Phone 7, now it’s time to have a look at the Android platform. In this post I will describe what you need to do to get started with Android development.

At developers.android.com there is a good Quick Start guide explaining step by step what you need to do to get started:

  1. Start with installing JDK 6
  2. Download Eclipse Classic 3.6.1 and unzip it on your disk (I unzipped it to location c:\eclipse)
  3. Download Android SDK (for Windows platform in my case) and unzip it on your disk (I unzipped it to location c:\android sdk)
  4. Add the android sdk location to your path
  5. Install the Android Development Tools (ADT) plugin in Eclipse. Remote update/install site: https://dl-ssl.google.com/android/eclipse/
  6. Add Android platforms and components to your SDK by running the SDK Manager. I chose accept all and install, this will give me all available Android platforms and components including Google API, Usb driver, samples and documentation.

You have now installed all you need and you can now follow the steps below to create your Android project and run the application from Eclipse. Once again developers.android.com have a good tutorial on how to create Hello World application:

  1. Set the Android SDK location in Eclipse. Select Window –>Preferences –> Android and browse to your Android SDK location. When you click Apply you will see the list of SDK targets available.
  2. Create Android Virtual Device (AVD) in Eclipse. Select Window –> Android SDK and AVD Manager –> Virtual Devices and click on New. Give the AVD a name, select your target and click Create AVD. I named my AVD “Android_2.2_AVD” and selected the Android 2.2 target
  3. Create a new Android project. Select File –> New project –> Android –> Android project and click next. Then fill in the project details: Project name, Build target, Application name, Package name and Activity must be specified.
  4. The project is now created and is visible in the Package explorer, I called the project HelloAndroid so the class HelloAndroid.java is generated for me. In the HelloAndroid.java you can add code for your GUI:
    package no.techcon.android;

    import android.app.Activity;
    import android.os.Bundle;
    import android.widget.TextView;

    public class HelloAndroid extends Activity {
    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {
    TextView tv = new TextView(this);
    tv.setText("My very first Android application");
  5. Run the application. Select Run –> Run and run as Android. The Android Emulator will now start and boot up (takes a while to boot the first time). When the emulator is finished booting your application is installed and started in the emulator:

You are now ready to continue developing Android applications and explore the possibilities within the Android SDK.


From http://breathingtech.com/2010/getting-started-with-android-development-using-eclipse/

Building Identity Management, including authentication and authorization? Try Stormpath! Our REST API and robust Java SDK support can eliminate your security risk and can be implemented in minutes. Sign up, and never build auth again!


The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}