Working with Android- Part 2: Creating your first program ‘Hello Android’

thomas6188

Broken In
Hi,
In one of my earlier post, I have discussed the configuration and installation of Android SDK in Eclispe IDE. In this post we shall be creating our first android program.

Step1: Starting a new project
1. New->Project->Android Project
A window opens up for filling the details about the new project.
2. Fill the required details.

Step2: Coding the program ‘Hello Android’
1. Explore your project on the left side panel.
2. Under the src directory, look for the activity page, in this case ‘hello.java’. Double click to open.
3. A java page opens up which consist of some pre written code. We have to write our code in this page.
4. Now you have to create a new Text View instance.
5. Write the below code after “super.onCreate(savedInstanceState);”
6. Our code
“TextView tv = new TextView(this);
tv.setText("Congratulations! You have created your first Android program");
setContentView(tv); “

Step3: Running the program
1. Run-->Run in the Run as window select "Android Application".

For more details and screenshots visit:
infiniteZest.com: A few basic imports in an Android application program
Working with Android- Part 2: Creating your first program ‘Hello Android’ ~ The IT Domain

Thanks
 
Top Bottom