Add Android app skeleton (Kotlin/Compose, Catppuccin Mocha theme)
Full app scaffold wired to the backend: onboarding, content-length picker, map screen (permission flow + text-search fallback), guide screen with a swipeable place-card stack driven by on-device TTS narration and a 60s re-scan loop, place detail screen with mute/favorite controls, favorites (Room-backed), and settings. Hilt for DI, Retrofit+kotlinx.serialization for the API client, DataStore for onboarding/content-length prefs, FusedLocationProviderClient for location. The 2GIS MapKit integration is isolated behind map/DgisMapView.kt (currently a placeholder) since its exact Maven coordinates need confirming from the 2GIS developer portal. Verified by actually building it: installed a minimal Android SDK (platform 34 + build-tools, no emulator) and JDK 17 locally, then ran :app:compileDebugKotlin, :app:assembleDebug (produced a real debug APK), and :app:lintDebug (0 errors, 44 non-blocking warnings, mostly "newer dependency version available"). Caught and fixed two real bugs this way: a wrong Maven artifact for the Retrofit kotlinx.serialization converter, and missing ExperimentalMaterial3Api opt-in. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
ca28c93daf
commit
c5596870fb
59 changed files with 2695 additions and 0 deletions
115
android/app/build.gradle.kts
Normal file
115
android/app/build.gradle.kts
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
import java.util.Properties
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
alias(libs.plugins.kotlin.android)
|
||||
alias(libs.plugins.kotlin.compose)
|
||||
alias(libs.plugins.kotlin.serialization)
|
||||
alias(libs.plugins.hilt.android)
|
||||
alias(libs.plugins.ksp)
|
||||
}
|
||||
|
||||
val localProperties = Properties().apply {
|
||||
val file = rootProject.file("local.properties")
|
||||
if (file.exists()) {
|
||||
file.inputStream().use { load(it) }
|
||||
}
|
||||
}
|
||||
|
||||
fun localProp(key: String, default: String): String =
|
||||
(localProperties.getProperty(key) ?: System.getenv(key) ?: default)
|
||||
|
||||
android {
|
||||
namespace = "com.guidecity.app"
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.guidecity.app"
|
||||
minSdk = 26
|
||||
targetSdk = 34
|
||||
versionCode = 1
|
||||
versionName = "0.1.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
buildConfigField(
|
||||
"String",
|
||||
"DGIS_API_KEY",
|
||||
"\"${localProp("DGIS_API_KEY", "")}\"",
|
||||
)
|
||||
buildConfigField(
|
||||
"String",
|
||||
"API_BASE_URL",
|
||||
"\"${localProp("API_BASE_URL", "http://10.0.2.2:8000/")}\"",
|
||||
)
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "17"
|
||||
freeCompilerArgs += listOf(
|
||||
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api",
|
||||
)
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
compose = true
|
||||
buildConfig = true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.androidx.core.ktx)
|
||||
implementation(libs.androidx.lifecycle.runtime.ktx)
|
||||
implementation(libs.androidx.lifecycle.viewmodel.compose)
|
||||
implementation(libs.androidx.activity.compose)
|
||||
|
||||
implementation(platform(libs.androidx.compose.bom))
|
||||
implementation(libs.androidx.ui)
|
||||
implementation(libs.androidx.ui.graphics)
|
||||
implementation(libs.androidx.ui.tooling.preview)
|
||||
implementation(libs.androidx.material3)
|
||||
implementation(libs.androidx.material.icons.extended)
|
||||
implementation(libs.androidx.navigation.compose)
|
||||
debugImplementation(libs.androidx.ui.tooling)
|
||||
|
||||
implementation(libs.hilt.android)
|
||||
ksp(libs.hilt.compiler)
|
||||
implementation(libs.hilt.navigation.compose)
|
||||
|
||||
implementation(libs.retrofit.core)
|
||||
implementation(libs.retrofit.kotlinx.serialization.converter)
|
||||
implementation(libs.okhttp.logging.interceptor)
|
||||
implementation(libs.kotlinx.serialization.json)
|
||||
|
||||
implementation(libs.androidx.room.runtime)
|
||||
implementation(libs.androidx.room.ktx)
|
||||
ksp(libs.androidx.room.compiler)
|
||||
|
||||
implementation(libs.androidx.datastore.preferences)
|
||||
|
||||
implementation(libs.play.services.location)
|
||||
implementation(libs.kotlinx.coroutines.play.services)
|
||||
|
||||
// 2GIS MapKit SDK: add once the exact Maven coordinates/repository are
|
||||
// confirmed from https://docs.2gis.com/ — see map/DgisMapView.kt for the
|
||||
// isolated integration point in the meantime.
|
||||
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.androidx.test.ext.junit)
|
||||
androidTestImplementation(libs.androidx.espresso.core)
|
||||
androidTestImplementation(platform(libs.androidx.compose.bom))
|
||||
androidTestImplementation(libs.androidx.ui.test.junit4)
|
||||
debugImplementation(libs.androidx.ui.test.manifest)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue