Android Hello World Example

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

Summary steps to develop an Android application : 1.Install Android SDK 2.Install ADT Eclipse plugin 3.

Create an Android Virtual Device (AVD) 4.Create Android Project with Eclipse (Wizard) 5.Code it 6.Start it in Android Virtual Device (AVD) Tools used : 1.JDK 1.6 2.Eclipse IDE 3.7 , Indigo 3.Android SDK

1. Android Hello World Example Create Android Project


In Eclipse, select File -> New -> Project., Android Project, and input your application detail. Eclipse will create all the necessary Android project files and configuration.

Hello World
Locate the generated activity file, and modify a bit to output a string Hello World. File : HelloWorldActivity.java
package com.mkyong.android; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class HelloWorldActivity 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 World, Android"); setContentView(text); } }

You might also like