七、 第一个 Android 应用( Hello , Android World! )
新建项目:打开Eclipse,选择 File > New > Project > Android Project,具体输入如下图:package org.deaboway.test;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class HelloAndroidWorld extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super .onCreate(savedInstanceState);
TextView textView = new TextView(this );
textView.setText("Hello Android World!");
setContentView(textView);
}
}
运行Android项目:点击工具栏的运行按钮,或选择菜单:Run->Run,或右键项目文件夹,会弹出“Run As”对话框,选择“Android Application”,点击“OK”按钮。