Initial commit: Norwegian emergency shelter finder app

Android app (Kotlin) that locates the nearest public shelter (tilfluktsrom)
in Norway. Designed for offline-first emergency use.

Features:
- Downloads and caches all 556 Norwegian shelter locations from Geonorge
- GPS-based nearest shelter finding with distance and bearing
- OSMDroid map with offline tile caching for surroundings
- Large directional compass arrow pointing to selected shelter
- Compass sensor integration for real-time direction updates
- Shows 3 nearest shelters with distance, capacity, and address
- Toggle between map view and compass/arrow view
- Auto-caches map tiles on first launch for offline use
- Weekly background data refresh with manual force-update
- i18n: Norwegian Bokmål, Nynorsk, and English

Technical:
- EPSG:25833 (UTM33N) → WGS84 coordinate conversion
- Haversine distance and bearing calculations
- Room database for shelter persistence
- Fused Location Provider for precise GPS
- Sensor fusion (rotation vector with accel+mag fallback) for compass

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ole-Morten Duesund 2026-03-08 16:14:19 +01:00
commit 27cad094e7
44 changed files with 2222 additions and 0 deletions

70
app/build.gradle.kts Normal file
View file

@ -0,0 +1,70 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.devtools.ksp")
}
android {
namespace = "no.naiv.tilfluktsrom"
compileSdk = 35
defaultConfig {
applicationId = "no.naiv.tilfluktsrom"
minSdk = 26
targetSdk = 35
versionCode = 1
versionName = "1.0.0"
}
buildTypes {
release {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
buildFeatures {
viewBinding = true
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
}
dependencies {
// AndroidX
implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("androidx.activity:activity-ktx:1.9.3")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7")
implementation("com.google.android.material:material:1.12.0")
implementation("androidx.constraintlayout:constraintlayout:2.2.0")
// Room (local database for shelter cache)
implementation("androidx.room:room-runtime:2.6.1")
implementation("androidx.room:room-ktx:2.6.1")
ksp("androidx.room:room-compiler:2.6.1")
// OkHttp (HTTP client for data downloads)
implementation("com.squareup.okhttp3:okhttp:4.12.0")
// OSMDroid (offline-capable OpenStreetMap)
implementation("org.osmdroid:osmdroid-android:6.1.20")
// Google Play Services Location (precise GPS)
implementation("com.google.android.gms:play-services-location:21.3.0")
// Coroutines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1")
}