1. 重要的文件夹
src: 存放所有的 *.java源程序
gen: adt插件自动生成的代码文件 其中 R.JAVA 为项目中所以资源的ID.
res: 项目资源文件 图片 布局文件 文本资源 layout:布局文件。
AndroidManifest.xml 项目配置文件
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.ddd"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.ddd.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
上面的文件是整个安卓项目的配置文件。
编程的时候 可以在 layout\main.xml 文件里手工添加组件,然后在 Activity里用 findViewbyId来调用。
也可以用直接利用构造方法实例化这些组件。
TextView text=new TextView(this);
text.setText(super.getString(R.string.info));
super.setcontentView(text);