Friday, April 20, 2012

First Android Application in Eclipse Hello world Android Example

0 comments
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 FirstAndroidAppActivity.java under src, and modify as bellow


package com.firstapp;

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

public class FirstAndroidAppActivity extends Activity {

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView text = new TextView(this);
text.setText("Hello Java Srilankan Support");
setContentView(R.layout.main);
}
}

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
































0 comments:

Post a Comment