mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-03-27 10:11:48 -04:00
2.5 KiB
2.5 KiB
Tech Stack
Programming Language
- Kotlin Multiplatform (KMP): The core logic is shared across Android, Desktop, and iOS using
commonMain.
Frontend Frameworks
- Compose Multiplatform: Shared UI layer for rendering on Android and Desktop.
- Jetpack Compose: Used where platform-specific UI (like charts or permissions) is necessary on Android.
Background & Services
- Platform Services: Core service orchestrations and background work are abstracted into
core:serviceto maximize logic reuse across targets, using platform-specific implementations (e.g., WorkManager/Service on Android) only where necessary.
Architecture
- MVI / Unidirectional Data Flow: Shared view models using the multiplatform
androidx.lifecycle.ViewModel. - JetBrains Navigation 3: Multiplatform fork for state-based, compose-first navigation without relying on
NavController. Navigation graphs are decoupled and extracted into their respectivefeature:*modules, allowing a thinned out rootappmodule.
Dependency Injection
- Koin 4.2: Leverages Koin Annotations and the K2 Compiler Plugin for pure compile-time DI, completely replacing Hilt.
Database & Storage
- Room KMP: Shared local database using multiplatform
DatabaseConstructor. - Jetpack DataStore: Shared preferences.
Networking & Transport
- Ktor: Multiplatform HTTP client for web services and TCP streaming.
- Kable: Multiplatform BLE library used as the primary BLE transport for all targets (Android, Desktop, and future iOS).
- jSerialComm: Cross-platform Java library used for direct Serial/USB communication with Meshtastic devices on the Desktop (JVM) target.
- KMQTT: Kotlin Multiplatform MQTT client and broker used for MQTT transport, replacing the Android-only Paho library.
- Coroutines & Flows: For asynchronous programming and state management.
Testing (KMP)
- Shared Tests First: The majority of business logic, ViewModels, and state interactions are tested in the
commonTestsource set using standardkotlin.test. - Coroutines Testing: Use
kotlinx-coroutines-testfor virtual time management in asynchronous flows. - Mocking Strategy: Avoid JVM-specific mocking libraries. Prefer
MokkeryorMockativefor multiplatform-compatible mocking interfaces, alongside handwritten fakes incore:testing. - Flow Assertions: Use
Turbinefor testing multiplatformFlowemissions and state updates. - Property-Based Testing: Use
Kotestfor multiplatform data-driven and property-based testing scenarios.