用的adt;
在启用时应该先更新各个api,建议4.0以上的都要。
环境变量:名:ANDROID_HOME,值:sdk的路径;名PATH,值%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools。
svn:Help -install new software,网址http://subclipse.tigris.org/update;
android的四个组建:
BroadcastReceiver 对系统事件监听
Content Provider 对外提供数据的地址
service 用于好使较长的操作:io,网络连接
activity 相当于页面
不同的版本生成的项目的代码不同;
activity_main.xml和MainActivity.java相通,大多数情况下能达到相同的效果:
MainActivity.java:
textView = (TextView)findViewById(R.id.textView);
textView.setText("hello mars");
activity_main.xml:
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="0" />
监听mainActivity.java(点击+1):
...
button = (Button)findViewById(R.id.button);
ButtonListener buttonListener = new ButtonListener();
button.setOnClickListener(buttonListener);
...
class ButtonListener implements OnClickListener{
public void onClick(View v){
count++;
textView.setText(count+"");
}
}
详细的步骤可以参见视频:http://www.marschen.com