no Pain no Gain no Gavin 博客同步更新至:http://blog.sina.com.cn/deaboway http://blog.csdn.net/deaboway
至此开发环境配置完成,接下来即可以进行Android上应用的开发。
七、 第一个Android应用(Hello,Android World!)
1. 新建项目:打开Eclipse,选择 File > New > Project > Android Project,具
体输入如下图:
21
2. 点击“Next”,提示如下:
22
3. 这里仅为演示,不创建测试项目。直接点击“Finish”按钮即可。
23
no Pain no Gain no Gavin 博客同步更新至:http://blog.sina.com.cn/deaboway http://blog.csdn.net/deaboway
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(\); setContentView(textView); } }
24
5. 运行Android项目:点击工具栏的运行按钮,或选择菜单:Run->Run,或右键项目文件夹,会弹出“Run As”对话框,选择“Android Application”,点击“OK”按钮。
6. 运行效果如下,AVD加载的速度有些慢,需要耐心等待。
25
Android SDK与Eclipse最新版开发环境搭建



