class LocationService : Service(), LocationCallback() override fun onLocationResult(result: LocationResult) val location = result.lastLocation location?.let // Update ViewModel via LiveData (application as MTIApp).locationRepository.updateLocation(it) // Check if geofence crossed checkGeofences(it)
@Entity(tableName = "trips") data class Trip( @PrimaryKey val tripId: String, val originLat: Double, val originLng: Double, val destLat: Double, val destLng: Double, val assignedAt: Long, val status: String // "pending", "active", "completed" ) mti driver app for android
[3] Phillips, E. (2021). Offline-First Apps with Kotlin and Room . O’Reilly Media. class LocationService : Service()