add GTFS static data

This commit is contained in:
2026-01-28 15:00:44 +01:00
parent 077c26eec7
commit ca2c5fe385
7 changed files with 204 additions and 13 deletions
@@ -4,7 +4,6 @@ import android.app.Activity
import android.os.Handler
import android.os.Looper
import android.widget.Toast
import androidx.compose.ui.semantics.getOrNull
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.Json
import okhttp3.OkHttpClient
@@ -22,12 +21,9 @@ data class HaukResponse(
val salt: String? = null
)
private val json = Json {
coerceInputValues = true // Coerce nulls to default values if applicable
ignoreUnknownKeys = true // Ignore fields in JSON not present in the data class
}
// OkHttpClient for making HTTP requests
val httpClient = OkHttpClient.Builder()
val haukhttpClient = OkHttpClient.Builder()
.build()
private val HaukMainHandler = Handler(Looper.getMainLooper())
@@ -44,7 +40,7 @@ private fun fetchHaukPosition(haukUrl: String, callee: Activity) {
.header("User-Agent", "${BuildConfig.APPLICATION_ID}/${BuildConfig.VERSION_NAME} (Android)")
.build()
httpClient.newCall(request).execute().use { response ->
haukhttpClient.newCall(request).execute().use { response ->
var message = if (response.isSuccessful) {
response.body?.string() ?: "Empty response"
} else {