2025-12-16 15:47:36 +08:00
|
|
|
plugins {
|
|
|
|
|
id("com.android.application")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
android {
|
|
|
|
|
namespace = "com.example.livestreaming"
|
|
|
|
|
compileSdk = 34
|
|
|
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
|
applicationId = "com.example.livestreaming"
|
|
|
|
|
minSdk = 21
|
|
|
|
|
targetSdk = 34
|
|
|
|
|
versionCode = 1
|
|
|
|
|
versionName = "1.0"
|
|
|
|
|
|
|
|
|
|
buildConfigField("String", "API_BASE_URL", "\"http://10.0.2.2:3001/api/\"")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
buildTypes {
|
2025-12-17 17:23:54 +08:00
|
|
|
debug {
|
|
|
|
|
// 调试版本优化
|
2025-12-16 15:47:36 +08:00
|
|
|
isMinifyEnabled = false
|
2025-12-17 17:23:54 +08:00
|
|
|
isDebuggable = true
|
|
|
|
|
}
|
|
|
|
|
release {
|
|
|
|
|
// 发布版本优化
|
|
|
|
|
isMinifyEnabled = true
|
|
|
|
|
isShrinkResources = true
|
2025-12-16 15:47:36 +08:00
|
|
|
proguardFiles(
|
|
|
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
|
|
|
"proguard-rules.pro"
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-12-17 17:23:54 +08:00
|
|
|
|
|
|
|
|
// 编译优化
|
|
|
|
|
dexOptions {
|
|
|
|
|
javaMaxHeapSize = "2g"
|
|
|
|
|
preDexLibraries = true
|
|
|
|
|
}
|
2025-12-16 15:47:36 +08:00
|
|
|
|
|
|
|
|
compileOptions {
|
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
|
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
buildFeatures {
|
|
|
|
|
viewBinding = true
|
|
|
|
|
buildConfig = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
|
implementation("androidx.core:core:1.12.0")
|
|
|
|
|
implementation("androidx.appcompat:appcompat:1.6.1")
|
|
|
|
|
implementation("com.google.android.material:material:1.11.0")
|
2025-12-17 15:38:00 +08:00
|
|
|
implementation("androidx.coordinatorlayout:coordinatorlayout:1.2.0")
|
2025-12-16 15:47:36 +08:00
|
|
|
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
|
|
|
|
implementation("androidx.recyclerview:recyclerview:1.3.2")
|
2025-12-17 15:38:00 +08:00
|
|
|
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
|
|
|
|
|
|
|
|
|
|
implementation("com.github.bumptech.glide:glide:4.16.0")
|
|
|
|
|
annotationProcessor("com.github.bumptech.glide:compiler:4.16.0")
|
2025-12-16 15:47:36 +08:00
|
|
|
|
|
|
|
|
implementation("com.squareup.retrofit2:retrofit:2.9.0")
|
|
|
|
|
implementation("com.squareup.retrofit2:converter-gson:2.9.0")
|
|
|
|
|
implementation("com.squareup.okhttp3:okhttp:4.12.0")
|
|
|
|
|
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
|
|
|
|
|
|
|
|
|
|
val media3Version = "1.2.1"
|
|
|
|
|
implementation("androidx.media3:media3-exoplayer:$media3Version")
|
|
|
|
|
implementation("androidx.media3:media3-exoplayer-hls:$media3Version")
|
|
|
|
|
implementation("androidx.media3:media3-ui:$media3Version")
|
|
|
|
|
}
|