现在的位置: 首页 > 综合 > 正文

Google.Android开发入门与实践-学习笔记3

2013年11月13日 ⁄ 综合 ⁄ 共 544字 ⁄ 字号 评论关闭

创建第一个hello Android应用

根据之前已经创建好的AVD,新建android project

代码如下:

package yangky.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. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     TextView tv = new TextView(this);
     tv.setText("Hello, Android~~~~~");
     setContentView(tv);
    }
}

然后点击运行,大概经历1到几分钟漫长等待,左侧的Android Emulator窗口终于显示了android模拟器

然后过会就显示了信息Hello, Android~~~~~(模拟器不会玩,得自己研究下,哈哈)

抱歉!评论已关闭.