Saturday, 1 September 2012

Simple hello application, Test Application



App1Activity.java

package com.app1;

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

public class App1Activity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Toast.makeText(getApplicationContext(),"Hello INDIA",Toast.LENGTH_LONG).show();
    }
}

main.xml


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#F00"
    >
<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Application-1"
    />
</LinearLayout>


No comments:

Post a Comment