Location: miles-tracker
| Feature | Status |
|---|---|
| Foreground service with persistent notification | ✅ |
| Speed display (km/h) in notification | ✅ |
| Lat/Long coordinates in notification | ✅ |
| Manual start/stop button | ✅ |
| Auto-start at speed > 10km/h | ✅ |
| OSM map with current location | ✅ |
| Route line drawing | ✅ |
| Location update counter (#value) | ✅ |
| Data persistence (route saved) | ✅ |
| Route restoration on app reopen | ✅ |
miles-tracker/
├── app/src/main/
│ ├── java/com/milestracker/app/
│ │ ├── MainActivity.kt # Main UI with map and controls
│ │ ├── LocationTrackingService.kt # Foreground service
│ │ ├── LocationRepository.kt # Data persistence
│ │ └── SpeedDetector.kt # Auto-start detection
│ ├── res/
│ │ ├── layout/activity_main.xml # UI layout
│ │ ├── values/ # Colors, strings, themes
│ │ └── drawable/ # Icons and backgrounds
│ └── AndroidManifest.xml # Permissions & components
├── build.gradle.kts # Dependencies
└── settings.gradle.kts
-
Open in Android Studio
- File → Open → Select
miles-trackerfolder - Wait for Gradle sync to complete
- File → Open → Select
-
Build the app
- Build → Make Project (or Ctrl+F9)
-
Run on device
- Connect Android phone via USB (enable USB debugging)
- Click Run (green play button)
- Grant all permissions when prompted
-
Test Features
- Tap "START TRACKING" to begin
- Walk/drive to see location updates and route line
- Check notification shows speed and coordinates
- Close and reopen app - route should persist
| File | Purpose |
|---|---|
| MainActivity.kt | UI, permissions, map integration |
| LocationTrackingService.kt | Foreground service, notification |
| LocationRepository.kt | SharedPreferences data storage |
| activity_main.xml | Dark theme UI layout |