BREAKING: Complete rewrite of data flow to fix network isolation issue. Problem: When connected to Bee's WiFi AP (192.168.0.10), the phone has NO internet access. The Bee AP is just a direct connection to the dashcam with no upstream gateway. The old design tried to simultaneously pull from Bee and push to ADAMaps, which fundamentally couldn't work. Solution: Store-and-forward with two independent subsystems: 1. BeeCollectorService - Collection only - Binds to unvalidated WiFi (Bee AP) - Polls Bee for detections - Stores to local Room database - Does NOT attempt internet uploads 2. AdaMapsUploadWorker - Upload only - WorkManager-based background worker - Only runs when device has VALIDATED internet - Reads from local DB, batch uploads to ADAMaps - Marks as synced, retries with backoff New components: - Room database (DetectionEntity, DetectionDao, VarroaDatabase) - NetworkStateMonitor for tracking validated vs unvalidated networks - Improved UI with BEE/LOCAL/UPLOAD indicators - Manual sync trigger when internet + pending data Version: 1.7.0 (versionCode 7)
80 lines
2.1 KiB
Kotlin
80 lines
2.1 KiB
Kotlin
plugins {
|
|
alias(libs.plugins.android.application)
|
|
alias(libs.plugins.kotlin.android)
|
|
alias(libs.plugins.kotlin.compose)
|
|
alias(libs.plugins.ksp)
|
|
}
|
|
|
|
android {
|
|
namespace = "com.adamaps.varroa"
|
|
compileSdk = 34
|
|
|
|
defaultConfig {
|
|
applicationId = "com.adamaps.varroa"
|
|
minSdk = 26
|
|
targetSdk = 34
|
|
versionCode = 7
|
|
versionName = "1.7.0"
|
|
|
|
vectorDrawables {
|
|
useSupportLibrary = true
|
|
}
|
|
}
|
|
|
|
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"
|
|
}
|
|
|
|
buildFeatures {
|
|
compose = true
|
|
}
|
|
|
|
packaging {
|
|
resources {
|
|
excludes += "/META-INF/{AL2.0,LGPL2.1}"
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation(libs.androidx.core.ktx)
|
|
implementation(libs.androidx.lifecycle.runtime.ktx)
|
|
implementation(libs.androidx.lifecycle.viewmodel.compose)
|
|
implementation(libs.androidx.lifecycle.service)
|
|
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)
|
|
implementation(libs.okhttp)
|
|
implementation(libs.gson)
|
|
implementation(libs.kotlinx.coroutines.android)
|
|
implementation(libs.osmdroid.android)
|
|
implementation(libs.datastore.preferences)
|
|
implementation(libs.coil.compose)
|
|
// Room (local database)
|
|
implementation(libs.room.runtime)
|
|
implementation(libs.room.ktx)
|
|
ksp(libs.room.compiler)
|
|
// WorkManager (background uploads)
|
|
implementation(libs.work.runtime.ktx)
|
|
debugImplementation(libs.androidx.ui.tooling)
|
|
}
|