Tutorial details

Android Hello World Example – How to develop android apps | App Code for Sale | Preview

Android Hello World Example – How to develop android apps | Android Tutorial

First step to develop your first Android application in Eclipse IDE using the ADT plugin and run it with an Android Virtual Device

Overview PAGE TOP

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 PAGE TOP

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.

gr.JPG

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

hgu.JPG

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.

kl.JPG

2. Download and Install the ADT Eclipse plugin PAGE TOP

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:

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

cal.JPG

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) PAGE TOP

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.

ari.JPG

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.

jao.JPG

hyi.JPG

4. Create an Android Project with Eclipse PAGE TOP

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

aso.JPG

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

jaoo.JPG

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.

tum.JPG

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.

ghe.JPG

And paste the following code in the OnCreate method:

01  package com.javacodegeeks.android.helloword;
02  
03  import android.app.Activity;
04  import android.os.Bundle;
05  import android.widget.TextView;
06  
07  public class MainActivity extends Activity {
08  
09      @Override
10      protected void onCreate(Bundle savedInstanceState) {
11          super.onCreate(savedInstanceState);
12  
13          TextView text = new TextView(this);
14          text.setText("Hello World of Android! - Greetings from Java Code Geeks");
15          setContentView(text);
16      }
17  
18  }

5. Run the Application in the Android Virtual Device PAGE TOP

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.

nehi.JPG

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:

  • “Android Full Application Tutorial” series
  • Android Google Maps Tutorial
  • Android Location Based Services Application
  • Android Game Development Tutorials

Reference PAGE TOP

http://www.javacodegeeks.com/2012/12/android-hello-world-example-how-to-develop-android-apps.html

0 Comments Leave a comment

Please login in order to leave a comment.

Newest first
!

Sign-in to your Chupamobile Account.

The Easiest way to Launch your next App or Game.

Join Chupamobile and get instant access to thousands of ready made App and Game Templates.

Creating an account means you’re okay with Chupamobile’s Terms of Service and Privacy Policy.