Android in Eclipse
Step 1: Go to android.com and download the android sdk by navigating like follows,
Download the sdk and install it in your system.
Note:
1. Give the path as c:\program files (if os installed on c drive).
2. Install all the packages of sdk that you have downloaded.
Step 2: Download the eclipse from eclipse.org
Step 3: Open the eclipse and go to Help -> Install New Softwares ->Add,
Give ok and you can see the window like this,
Check the developer tools check box then give next and finish.
Step 4: Go to windows -> preferences and choose android. If you get any errors then check that the path of the android sdk that you have installed on your system.
Step 5: Then start programming with android in eclipse.
File -> new -> project (android application) -> HelloWorld once it is opened,
copy the following code,
package com.example.helloworld;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.TextView;
public class HelloWorld extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_hello_world);
TextView agnPrint = new TextView(this);
agnPrint.setText(“Hello Naveen Welcome to Android Development”);
setContentView(agnPrint);
}
}
Step 6: Go to run -> android application, first time it usually ask us to add AVD (Android Virtual Device) for target display, so add it as follows,
Then click the manager and click the new then you can see one window, just fill that window options as like follows,
you have successfully added AVD target.
Step 7: Finally if you run your helloworld program then you can see the output as follows,
Thanks for reading this post….!!