Friday, April 20, 2012

First Android Application in Eclipse Hello world Android Example

Android hello world example

In this tutorial, I am going show you how to create your very first Android Application.First of all you need to Setup Android Development Environment, visit How to setup Android Development Environment in With Eclipse, to setup your How to setup android development environment.

Create Android Project

Start Eclipse, File -> New -> Android Project and input Application name, Build Target which is your android OS platform and the Package name under properties and finish.Eclipse will create all unnecessary configuration and files to your project application.

New Android Project
First Android Project

Modify the Activity class

Find the activity class under src, and modify as bellow

package com.firstapp;

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

public class FirstAndroidAppActivity extends Activity {

/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
TextView text = new TextView(this);
text.setText("Hello Java Srilankan Support");

Run as Android Application

You will see "Hello Java Srilankan Support" on the virtual device (AVD)

Run as Android Application

Android Virtual Device (AVD)

In home you will be see your FirstAndroidApp


Post a Comment