Friday 28 October 2011

Android First program Hello_World step by step.

 1.Download the eclipse -directly from here  (for window 32-bit only). 
    for other visit www.eclipse.org

2.Download window installer - from here

 3.Download ADT plug-in-- from here

 4.Now install the window installer downloaded in step-2

5.start the SDK manager.

6. Download the android platform (will take time). You must download at least one platform.

7.Open Eclipse and go to window option and then prefrence in eclipse and browse the android-sdk folder generally

it is located in C:\Program File\Android\android-sdk and click apply and then OK.

8.Now goto help and then install new software

9.Click on Add button Browse the ADT plug-in zip file(downloaded in step-3) click next now ADT plug-in

is installed.

.10.After finishing download in eclipse goto file->new project->Android

11.Give any name of project choose the sdk version (any one) give the application
name (anything).

Give the package name like com.example.myapp.

Give the activity name whatever you want.

Click finish

Your activity will open and something is already written in it

Like

Public void onCreate(……………..)

This is your main function .

112. now write it so that it look like.

package com.example.helloandroid;//your given package name

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

public class HelloAndroid extends Activity {
/** Called when the
activity is first created. */
@Override
public void onCreate(Bundle
savedInstanceState)
{
super.onCreate(savedInstanceState);
TextView tv =
new TextView(this);
tv.setText("Hello,
Android");
setContentView(tv);
} }

Now save it and right click on project and run it.

That is your hello, Android application.

No comments:

Post a Comment