Nikos Maravitsas

About Nikos Maravitsas

Nikos has graduated from the Department of Informatics and Telecommunications of The National and Kapodistrian University of Athens. Currently, his main interests are system’s security, parallel systems, artificial intelligence, operating systems, system programming, telecommunications, web applications, human – machine interaction and mobile development.

Android Hello World Example – How to develop android apps

In this tutorial, we will go through the necessary steps you need to take in order to develop your first Android application in Eclipse IDE using the ADT plugin and run it with an Android Virtual Device.

The ADT plugin provides easy Android Project creation and management with rich editor features and documentation as well as Android Virtual Device (AVD) management.
 
 

 

 
The steps :

  1. Download and Install the Android SDK
  2. Download and Install the ADT Eclipse plugin
  3. Create an Android Virtual Device (AVD)
  4. Create an Android Project with Eclipse
  5. Run the Application in the Android Virtual Device

We will use the following tools in a Windows 64-bit platform:

  1. JDK 1.7
  2. Eclipse 4.2 Juno
  3. Android SKD 4.2

1. Download and Install the Android SDK

Go to the Android SDK page, and download the appropriate version for your platform. You can choose to download  the ADT (Android Development Tools) bundle, in which you will find both Eclipse and the Android SDK. But if you already have an Eclipse instance in your pc, click “USE AN EXISTING IDE” and Download the SDK Tools for your platform. This will download an installer to your system.

Run the installer and choose the SDK Path in which the SDK will be installed.

When the installation is finished, launch the Android SDK Manager.

The Android SDK Manager will  install the Android Version you want to use and other tools and APIs as well. We are going to use Android 4.2.

2. Download and Install the ADT Eclipse plugin

In this step we are going to integrate Android SDK with Eclipse IDE, using the ADT (Android Development Tools) plugin.

Open Eclipse and select Help -> Install New Software…, and in the first textfield put the following URL and click Add:

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

You may click Select All and Next to install the ADT. If you face any problems with the installation of the ADT plugin or if it is taking way to long to download and install, you can try installing the ADT manually and, of course you can follow the Troubleshooting Instructions.

3. Create an Android Virtual Device (AVD)

When you are done installing the ADT plugin you will be asked to restart the IDE. After restarting Eclipse, notice the two Android Development Tools Icons on the Eclipse Toolbar.

Using  these Icons you can instantly open the Android SDK Manager and setup  an Android Virtual Device (AVD) respectively. Click the right icon and in the pop up window click New to add a new Virtual Device.

4. Create an Android Project with Eclipse

Now it’s time to create a new Android project. Select File -> New -> Project. Then select Android Application Project and click Next.

After specifying the Applications details (e.g. Application name) , go to the Project Explorer.

Right click on the project name (in this case “HelloWorld”…) and select New->Android Activity. If Android Activity doesn’t show up, select New->Other->Android->Android Activity.

And click Next. You will be asked to specify some details about this Activity (e.g. name). Then, navigate to the java file which contains the source code of the new activity.

And paste the following code in the OnCreate method:

package com.javacodegeeks.android.helloword;

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

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

        TextView text = new TextView(this);
        text.setText("Hello World of Android! - Greetings from Java Code Geeks");
        setContentView(text);
	}

}

5. Run the Application in the Android Virtual Device

You can now Run the project as Android Application. The emulator will be launched. This usually takes some time. So, when you are working on a Project, just launch the emulator once and leave it open.

Download Eclipse Project

Download the Eclipse Project of this tutorial HelloWorld.zip.

More Android Tutorials

This post was a quick introduction that will get you up and running in Android Development. You can see more Android tutorials in the following links:

Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

JPA Mini Book

Learn how to leverage the power of JPA in order to create robust and flexible Java applications. With this Mini Book, you will get introduced to JPA and smoothly transition to more advanced concepts.

JVM Troubleshooting Guide

The Java virtual machine is really the foundation of any Java EE platform. Learn how to master it with this advanced guide!

Given email address is already subscribed, thank you!
Oops. Something went wrong. Please try again later.
Please provide a valid email address.
Thank you, your sign-up request was successful! Please check your e-mail inbox.
Please complete the CAPTCHA.
Please fill in the required fields.

7 Responses to "Android Hello World Example – How to develop android apps"

  1. Thank you for this tutorial. I have seen many young developers wanting to enter the industry using the android platform as it is one of the leaders of the industry. Moreover, many organizations who plan to make their own apps for internal purposes, can take advantage of this article and make their apps according to their needs. Great work!

  2. Pavan Deshpande says:

    Very nice tutorial you can also check this one

    http://pavanhd.blogspot.in/2012/09/android-hello-world-example.html

  3. Seenivasan says:

    thanks for your setup by step process to start andriod application…

  4. Sathish says:

    Great Thank u :) :)

  5. zuhra says:

    thanks …..for helping ……but it will be very thankfull to u if this tutorial will b for 32 bit windows

Leave a Reply


1 × = six



Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use | Privacy Policy
All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.
Do you want to know how to develop your skillset and become a ...
Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

Get ready to Rock!
You can download the complementary eBooks using the links below:
Close