Hey guys, I was wondering if someone could help me interpret line by line what is happening in this code...

package com.example.helloandroid;

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

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

I don't know much about Android development, but I know it's very similar to a 'normal' Java programming environment.

For this specific piece of code:



is what returns information to the application in the event that an activity is interrupted (restart, detroyed, etc), if that makes sense.

In main, a 'tv' object is being created from the class 'TextView' which I am guessing is part of the Android SDK package.

Here it is: http://developer.android.com/reference/android/widget/TextView.html

a class-specific function is then called:

tv.setText("Hello, Android");

along with what looks to be pre-defined function with the object as an argument:


I would suggest reading up on this site to learn as much as you can about the Android SDK: