add GTFS static data
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user