Hello Android!

Make sure you a working Android development platform ready.

Start with making a new virtual Android mobile, if you haven’t done that already.

android create avd --target 3 --name My_Android

File -> New -> New Project …

And select “Android Project” and then next.

In the next dialogue, fill in the fields as following.

Project name: Hello_Android
Build target: Android 1.5
Package name: org.example.hello
Min SDK version: 3

And Finish.

Now your Eclipse should look something like this:

Change the source to this:

package org.example.hello;

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

public class Hello 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);
    }
}

This was my notes from when going through the Hello World tutorial.

VN:F [1.9.13_1145]
Rating: 0.0/5 (0 votes cast)
Share

Leave a Reply

Leave a Reply
  • (required)
  • (required) (will not be published)