$ show CompassMB/MBCompass
MBCompass is a free, open-source Android compass and navigation application built with Jetpack Compose and modern Android architecture. It provides a digital compass with true/magnetic north support, declination correction, and sensor fusion for accuracy. The app integrates online and offline maps (via OSMDroid and MapsForge), GPS location tracking, and full track recording capabilities including start/pause/resume, GPX export/import, and detailed statistics (distance, speed, elevation, ascent/descent). The UI follows Material Design 3 with support for dynamic theming, AMOLED dark mode, and multiple languages. The architecture follows a feature-based package structure with MVVM pattern, using Hilt for dependency injection, DataStore for user preferences, and Kotlin Serialization for track persistence. Key modules include a foreground service for GPS tracking, a sensor event listener with lifecycle-aware registration, and a repository pattern for track CRUD operations. The app is lightweight (~2 MB), privacy-focused (no ads, no analytics), and supports Android 6+ with target SDK 33+. While the codebase demonstrates solid engineering practices with clean abstractions and reusable UI components, there are signs of technical drift including deprecated LocationListener APIs, scoped storage concerns, and potential library version lag. The project appears actively maintained with recent changelogs, extensive translations, and community engagement via Weblate and GitHub issues.
The LLM identified 4 files worth highlighting for reuse:
A reusable permission handling composable that manages location and notification permissions with a state-driven approach. It provides education dialogs, rationale explanations, and handles permission denial gracefully. The pattern is isolated and can be extracted for any Android app requiring runtime permissions.
A ViewModel that fuses rotation vector and magnetic field sensors to compute azimuth, pitch, and roll with accuracy estimation. It exposes a clean StateFlow for UI consumption and handles sensor registration lifecycle via DisposableEffect. The sensor fusion logic is self-contained and reusable for any compass or orientation-based app.
A builder-pattern utility that constructs GPX XML from track waypoints and metadata. It handles namespaces, timestamps, elevation, and extensions. The class is stateless and parameterized, making it reusable for any app needing GPX export without external dependencies.
A custom bottom navigation bar with animated indicator using spring transitions. It supports dynamic item count, selected state, and Material3 theming. The component is self-contained and can be extracted for any Jetpack Compose app requiring a polished bottom bar with smooth animations.