前情提要
The Android Project View
1. Android Manifest file
AndroidManifest.xml is required for every Android app.1. Android Manifest file
2. Activity
app/java.res/layout.3. Resources
developer.android.com3.1 Drawable
.png file.R.drawable.xxx @drawable/xxxdpi rather than px.px: Pixeldp: Density-independent pixel, that is, one physical pixel on a 160-dpi screendpi: Dots Per Inch3.1 Drawable
(x1.0)(x1.5)(x2.0)(x2.6, x3.0)(x3.5, x4.0)3.2 Layout
R.layout.xxx3.3 Values
R.string.xxx @string/xxxR.color.xxx @color/xxxR.style.xxx @style/xxx3.3 Mipmap
@mipmap/xxx3.4 Anim, Animator
anim, animator is not necessory in the project.4. Gradle Scripts
Gradle Scripts directory stores the application’s build files.
android {
compileSdkVersion 26
defaultConfig {
applicationId "tw.kaiyeee.android.firstapp"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}