创建第一个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~~~~~(模拟器不会玩,得自己研究下,哈哈)