A minimal, high-performance Android app for tracking motorbike rides in real-time with GPS, speed, and itinerary logging.
- Riding Screen: Start/pause/stop ride tracking with live stats (time, distance, speed, avg speed, max speed)
- Diary Screen: Historical view of all completed trips with summary statistics
- GPS Tracking: Continuous location updates every 5-10 seconds using Fused Location Provider
- Trip Storage: SQLite database (Room ORM) persisting trips and coordinates
- Map Visualization: Display completed ride routes as polylines on OpenStreetMap (no API key required)
- Minimal Design: No code duplication, clean architecture, zero unnecessary comments
- Language: Kotlin
- UI Framework: Jetpack Compose (Material 3)
- Navigation: Jetpack Navigation Compose
- Database: Room ORM with SQLite
- Location: Google Play Services (Fused Location Provider)
- Maps: OpenStreetMap (Osmdroid) - no API key required
- Async: Coroutines + Flow for reactive data
- Target SDK: 37
- Android Studio
- Android SDK 34+ with build-tools
- Gradle 8.2+
-
Clone and open in Android Studio
git clone <repo> cd nyoom open -a "Android Studio" .
-
Sync Gradle (Android Studio will prompt)
-
Build APK
./gradlew assembleDebug
-
Install and run
adb install app/build/outputs/apk/debug/app-debug.apk adb shell am start -n com.nyoom/.MainActivity
- Start: Tap "Start" → grant location permission → GPS tracking begins
- Monitor: Watch real-time distance, speed, avg speed, max speed
- Pause: Tap "Pause" to pause tracking (battery-friendly)
- Resume: Tap "Resume" to continue
- Stop: Tap "Stop" → trip saved to database with all coordinates
- View trips: Swipe to Diary tab to see all past rides
- Trip details: Each card shows date, distance, duration, avg/max speed
- Delete: Tap "Delete" to remove a trip and its coordinates
- Tap a trip card → shows polyline route on OpenStreetMap
- Map is centered on the trip route and allows interactive panning/zooming
- No Background Tracking (MVP): App pauses GPS when backgrounded to simplify permissions and reduce battery drain
- Fused Location Provider: Automatically selects best source (GPS/WiFi/cellular); better than raw LocationManager
- 5-10s GPS Intervals: Balances accuracy for motorbike speeds (100+ km/h) vs. battery drain
- Room ORM: Type-safe, compile-time checked queries; avoids SQL injection
- CompositionLocals for DI: Cleaner than passing dependencies through Compose parameters
- Separate Trip/Coordinate Tables: Normalizes schema; long rides don't duplicate trip metadata
- No Real-Time Map (MVP): Polyline display only post-ride; drawing polylines with map animation requires performance optimization deferred to v2
"Permission denied for location"
- Grant
ACCESS_FINE_LOCATIONat runtime on Android 6+ - Verify in
AndroidManifest.xmlandapp/build.gradle.kts
"No GPS signal indoors"
- Use Android Emulator's mock location feature or GPX playback
- Real devices need clear sky view for GPS lock
"Database migration error"
- Increment
@Database(version = X)when schema changes - Write migration using
addMigrations(MIGRATION_X_Y)
Database
- Query
adb shell sqlite3 /data/data/com.nyoom/databases/trip_databaseto verify trip/coordinate inserts