[CREATE] Hello World program for android via Netbeans

Well friends, as I started programming on android on my windows with IDE as Netbeans. I am writing every step that were problems to me and how I solved then. You can get subscribed so that you can get more and more help regarding android application development. Before going to all the thing you must have first setup all the requirements as of my previous article.

Now, just follow the step as I tell below for the very first android program on as HelloWorld.

Goto File > New Project.

Choose a project a Android > Android Project. And click Next>.

There are some information to be filled up as below:

The click Finish.

You find the source code as:

package com.test.helloworld;

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

public class helloworld extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}

Now what you do is change the code to following:

package com.test.helloworld;

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

public class helloworld extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView text1 = new TextView(this);
text1.setText(“Hello World”);
setContentView(text1);
}
}

After that is done, Build the program.

After the program is build successfully, Run the program. An emulator window will open. After the emulator opens and the OS on the emulator gets loaded, go to its Menu. And view the program named helloworld. Your will see the result. If you could not find the application that you just made, you have to do the installation of the application manually.

Command-line installation of android .apk file