Language/Android

Hello world Activity Demo

아르비스 2010. 6. 1. 16:35
Android Hello world Activity Test

1. Android Project 생성

2. HelloDemos.java 수정
 package sncap.android.apis;

import sncap.android.apis.R;

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

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

3. layout/ hello_world.xml 추가
<TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/text"
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    android:gravity="center_vertical|center_horizontal"
    android:text="Hellow World Demo Activity Test!!"/>

4. AndroidManifest.xml 수정
        <activity android:name=".HelloDemos"
                  android:label="Activity Hello world!!">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>


컴파일...
완료..