# meshtastic/meshtastic-android architecture

> Architecture diagram of the GitHub repository meshtastic/meshtastic-android, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/meshtastic/meshtastic-android
- Repository: https://github.com/meshtastic/meshtastic-android

## Overview

Meshtastic is a mobile mesh-radio client, with a Compose Desktop counterpart. The principal workflow is a user initiating an operation in the app, which is handled by service and transport layers and communicated to a nearby mesh radio; incoming radio data is processed by the app. Discovery is a distinct workflow that scans radio presets, collects node information, and persists session results. README capabilities such as maps, firmware updates, NFC sharing, Wi-Fi provisioning, and system-AI integration are included where the tree supports a source location. Several feature paths are unsampled, so only documented or indexed relationships are drawn.

Main entry points: [`core/repository/src/commonMain/kotlin/org/meshtastic/core/repository/RadioInterfaceService.kt`](https://github.com/meshtastic/meshtastic-android/blob/main/core/repository/src/commonMain/kotlin/org/meshtastic/core/repository/RadioInterfaceService.kt) (Radio transport), [`feature/discovery/src/commonMain/kotlin/org/meshtastic/feature/discovery/DiscoveryScanEngine.kt`](https://github.com/meshtastic/meshtastic-android/blob/main/feature/discovery/src/commonMain/kotlin/org/meshtastic/feature/discovery/DiscoveryScanEngine.kt) (Discovery scan), [`core/service/src/commonMain/kotlin/org/meshtastic/core/service/SharedRadioInterfaceService.kt`](https://github.com/meshtastic/meshtastic-android/blob/main/core/service/src/commonMain/kotlin/org/meshtastic/core/service/SharedRadioInterfaceService.kt) (Service orchestration), [`androidApp/src/main/kotlin/org/meshtastic/app/ui/Main.kt`](https://github.com/meshtastic/meshtastic-android/blob/main/androidApp/src/main/kotlin/org/meshtastic/app/ui/Main.kt) (App UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_app_ui["App UI<br/>[Main.kt]"]
  node_map["Maps and waypoints<br/>[MapView.kt]"]
  node_map_layers["Map layers<br/>[MapLayer.kt]"]
  node_kml_import["KML import<br/>[KmlImport.kt]"]
end

subgraph group_mesh["Mesh connectivity"]
  node_service_orchestrator["Service orchestration"]
  node_query["Mesh queries"]
  node_radio_transport["Radio transport"]
  node_ble["Bluetooth transport"]
end

subgraph group_discovery["Mesh discovery"]
  node_discovery_scan["Discovery scan"]
  node_discovery_rank["Discovery ranking"]
  node_discovery_store[("Discovery records")]
end

subgraph group_capabilities["Specialized features"]
  node_firmware["Firmware updates"]
  node_api["Meshtastic API<br/>[ApiService.kt]"]
  node_nfc["NFC sharing"]
  node_wifi["Wi-Fi provisioning"]
  node_app_functions["App Functions"]
  node_assistant_service["Assistant service"]
  node_ai_provider["AI function provider"]
end

node_user(("User"))
node_radio{{"Mesh radio"}}

node_user -->|"uses"| node_app_ui
node_app_ui -.->|"starts services"| node_service_orchestrator
node_service_orchestrator -.->|"orchestrates"| node_radio_transport
node_radio_transport -->|"exchanges radio data"| node_radio
node_radio_transport -.->|"uses Bluetooth"| node_ble
node_ble -->|"connects"| node_radio
node_service_orchestrator -.->|"exposes queries"| node_query
node_query -.->|"sends requests"| node_radio_transport
node_user -->|"starts scan"| node_discovery_scan
node_discovery_scan -->|"persists sessions"| node_discovery_store
node_discovery_scan -.->|"uses ranking"| node_discovery_rank
node_discovery_scan -.->|"scans presets"| node_radio_transport
node_user -->|"views map"| node_map
node_map -.->|"displays layers"| node_map_layers
node_user -.->|"imports KML"| node_kml_import
node_user -.->|"updates firmware"| node_firmware
node_firmware -.->|"fetches releases"| node_api
node_user -->|"shares by NFC"| node_nfc
node_user -.->|"provisions Wi-Fi"| node_wifi
node_assistant_service -->|"routes functions"| node_app_functions
node_app_functions -->|"uses provider"| node_ai_provider

click node_app_ui "https://github.com/meshtastic/meshtastic-android/blob/main/androidApp/src/main/kotlin/org/meshtastic/app/ui/Main.kt"
click node_service_orchestrator "https://github.com/meshtastic/meshtastic-android/blob/main/core/service/src/commonMain/kotlin/org/meshtastic/core/service/SharedRadioInterfaceService.kt"
click node_query "https://github.com/meshtastic/meshtastic-android/blob/main/core/service/src/commonMain/kotlin/org/meshtastic/core/service/QueryControllerImpl.kt"
click node_radio_transport "https://github.com/meshtastic/meshtastic-android/blob/main/core/repository/src/commonMain/kotlin/org/meshtastic/core/repository/RadioInterfaceService.kt"
click node_ble "https://github.com/meshtastic/meshtastic-android/blob/main/core/ble/src/commonMain/kotlin/org/meshtastic/core/ble/BluetoothRepository.kt"
click node_discovery_scan "https://github.com/meshtastic/meshtastic-android/blob/main/feature/discovery/src/commonMain/kotlin/org/meshtastic/feature/discovery/DiscoveryScanEngine.kt"
click node_discovery_rank "https://github.com/meshtastic/meshtastic-android/blob/main/feature/discovery/src/commonMain/kotlin/org/meshtastic/feature/discovery/scan/DiscoveryRankingEngine.kt"
click node_discovery_store "https://github.com/meshtastic/meshtastic-android/blob/main/core/database/src/commonMain/kotlin/org/meshtastic/core/database/entity/DiscoverySessionEntity.kt"
click node_map "https://github.com/meshtastic/meshtastic-android/blob/main/androidApp/src/google/kotlin/org/meshtastic/app/map/MapView.kt"
click node_map_layers "https://github.com/meshtastic/meshtastic-android/blob/main/androidApp/src/main/kotlin/org/meshtastic/app/map/MapLayer.kt"
click node_kml_import "https://github.com/meshtastic/meshtastic-android/blob/main/androidApp/src/main/kotlin/org/meshtastic/app/map/KmlImport.kt"
click node_firmware "https://github.com/meshtastic/meshtastic-android/blob/main/feature/firmware/src/commonMain/kotlin/org/meshtastic/feature/firmware/DefaultFirmwareUpdateManager.kt"
click node_api "https://github.com/meshtastic/meshtastic-android/blob/main/core/network/src/commonMain/kotlin/org/meshtastic/core/network/service/ApiService.kt"
click node_nfc "https://github.com/meshtastic/meshtastic-android/blob/main/core/nfc/src/main/kotlin/org/meshtastic/core/nfc/MeshtasticHostApduService.kt"
click node_wifi "https://github.com/meshtastic/meshtastic-android/blob/main/feature/wifi-provision/src/commonMain/kotlin/org/meshtastic/feature/wifiprovision/domain/NymeaWifiService.kt"
click node_app_functions "https://github.com/meshtastic/meshtastic-android/blob/main/androidApp/src/google/kotlin/org/meshtastic/app/ai/appfunctions/MeshtasticAppFunctions.kt"
click node_assistant_service "https://github.com/meshtastic/meshtastic-android/blob/main/androidApp/src/google/kotlin/org/meshtastic/app/ai/appfunctions/BaseMeshtasticAppFunctionService.kt"
click node_ai_provider "https://github.com/meshtastic/meshtastic-android/blob/main/core/data/src/commonMain/kotlin/org/meshtastic/core/data/ai/AiFunctionProvider.kt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app_ui,node_map,node_map_layers,node_kml_import,node_user toneBlue
class node_service_orchestrator,node_query,node_radio_transport,node_ble toneAmber
class node_discovery_scan,node_discovery_rank,node_discovery_store toneMint
class node_firmware,node_api,node_nfc,node_wifi,node_app_functions,node_assistant_service,node_ai_provider toneRose
class node_radio toneIndigo
```

## Components

### App experience

- [App UI](https://github.com/meshtastic/meshtastic-android/blob/main/androidApp/src/main/kotlin/org/meshtastic/app/ui/Main.kt): `androidApp/src/main/kotlin/org/meshtastic/app/ui/Main.kt`
- [Maps and waypoints](https://github.com/meshtastic/meshtastic-android/blob/main/androidApp/src/google/kotlin/org/meshtastic/app/map/MapView.kt): `androidApp/src/google/kotlin/org/meshtastic/app/map/MapView.kt`
- [Map layers](https://github.com/meshtastic/meshtastic-android/blob/main/androidApp/src/main/kotlin/org/meshtastic/app/map/MapLayer.kt): `androidApp/src/main/kotlin/org/meshtastic/app/map/MapLayer.kt`
- [KML import](https://github.com/meshtastic/meshtastic-android/blob/main/androidApp/src/main/kotlin/org/meshtastic/app/map/KmlImport.kt): `androidApp/src/main/kotlin/org/meshtastic/app/map/KmlImport.kt`

### Mesh connectivity

- [Service orchestration](https://github.com/meshtastic/meshtastic-android/blob/main/core/service/src/commonMain/kotlin/org/meshtastic/core/service/SharedRadioInterfaceService.kt): `core/service/src/commonMain/kotlin/org/meshtastic/core/service/SharedRadioInterfaceService.kt`
- [Mesh queries](https://github.com/meshtastic/meshtastic-android/blob/main/core/service/src/commonMain/kotlin/org/meshtastic/core/service/QueryControllerImpl.kt): `core/service/src/commonMain/kotlin/org/meshtastic/core/service/QueryControllerImpl.kt`
- [Radio transport](https://github.com/meshtastic/meshtastic-android/blob/main/core/repository/src/commonMain/kotlin/org/meshtastic/core/repository/RadioInterfaceService.kt): `core/repository/src/commonMain/kotlin/org/meshtastic/core/repository/RadioInterfaceService.kt`
- [Bluetooth transport](https://github.com/meshtastic/meshtastic-android/blob/main/core/ble/src/commonMain/kotlin/org/meshtastic/core/ble/BluetoothRepository.kt): `core/ble/src/commonMain/kotlin/org/meshtastic/core/ble/BluetoothRepository.kt`

### Mesh discovery

- [Discovery scan](https://github.com/meshtastic/meshtastic-android/blob/main/feature/discovery/src/commonMain/kotlin/org/meshtastic/feature/discovery/DiscoveryScanEngine.kt): `feature/discovery/src/commonMain/kotlin/org/meshtastic/feature/discovery/DiscoveryScanEngine.kt`
- [Discovery ranking](https://github.com/meshtastic/meshtastic-android/blob/main/feature/discovery/src/commonMain/kotlin/org/meshtastic/feature/discovery/scan/DiscoveryRankingEngine.kt): `feature/discovery/src/commonMain/kotlin/org/meshtastic/feature/discovery/scan/DiscoveryRankingEngine.kt`
- [Discovery records](https://github.com/meshtastic/meshtastic-android/blob/main/core/database/src/commonMain/kotlin/org/meshtastic/core/database/entity/DiscoverySessionEntity.kt): `core/database/src/commonMain/kotlin/org/meshtastic/core/database/entity/DiscoverySessionEntity.kt`

### Specialized features

- [Firmware updates](https://github.com/meshtastic/meshtastic-android/blob/main/feature/firmware/src/commonMain/kotlin/org/meshtastic/feature/firmware/DefaultFirmwareUpdateManager.kt): `feature/firmware/src/commonMain/kotlin/org/meshtastic/feature/firmware/DefaultFirmwareUpdateManager.kt`
- [Meshtastic API](https://github.com/meshtastic/meshtastic-android/blob/main/core/network/src/commonMain/kotlin/org/meshtastic/core/network/service/ApiService.kt): `core/network/src/commonMain/kotlin/org/meshtastic/core/network/service/ApiService.kt`
- [NFC sharing](https://github.com/meshtastic/meshtastic-android/blob/main/core/nfc/src/main/kotlin/org/meshtastic/core/nfc/MeshtasticHostApduService.kt): `core/nfc/src/main/kotlin/org/meshtastic/core/nfc/MeshtasticHostApduService.kt`
- [Wi-Fi provisioning](https://github.com/meshtastic/meshtastic-android/blob/main/feature/wifi-provision/src/commonMain/kotlin/org/meshtastic/feature/wifiprovision/domain/NymeaWifiService.kt): `feature/wifi-provision/src/commonMain/kotlin/org/meshtastic/feature/wifiprovision/domain/NymeaWifiService.kt`
- [App Functions](https://github.com/meshtastic/meshtastic-android/blob/main/androidApp/src/google/kotlin/org/meshtastic/app/ai/appfunctions/MeshtasticAppFunctions.kt): `androidApp/src/google/kotlin/org/meshtastic/app/ai/appfunctions/MeshtasticAppFunctions.kt`
- [Assistant service](https://github.com/meshtastic/meshtastic-android/blob/main/androidApp/src/google/kotlin/org/meshtastic/app/ai/appfunctions/BaseMeshtasticAppFunctionService.kt): `androidApp/src/google/kotlin/org/meshtastic/app/ai/appfunctions/BaseMeshtasticAppFunctionService.kt`
- [AI function provider](https://github.com/meshtastic/meshtastic-android/blob/main/core/data/src/commonMain/kotlin/org/meshtastic/core/data/ai/AiFunctionProvider.kt): `core/data/src/commonMain/kotlin/org/meshtastic/core/data/ai/AiFunctionProvider.kt`

### Other components

- **User**
- **Mesh radio**

## Connections

- User → App UI: uses (evidence: `README.md`)
- App UI → Service orchestration: starts services
- Service orchestration → Radio transport: orchestrates
- Radio transport → Mesh radio: exchanges radio data (evidence: `core/repository/src/commonMain/kotlin/org/meshtastic/core/repository/RadioInterfaceService.kt`)
- Radio transport → Bluetooth transport: uses Bluetooth
- Bluetooth transport → Mesh radio: connects (evidence: `README.md`)
- Service orchestration → Mesh queries: exposes queries
- Mesh queries → Radio transport: sends requests
- User → Discovery scan: starts scan (evidence: `README.md`)
- Discovery scan → Discovery records: persists sessions (evidence: `feature/discovery/src/commonMain/kotlin/org/meshtastic/feature/discovery/DiscoveryScanEngine.kt`)
- Discovery scan → Discovery ranking: uses ranking
- Discovery scan → Radio transport: scans presets
- User → Maps and waypoints: views map (evidence: `README.md`)
- Maps and waypoints → Map layers: displays layers
- User → KML import: imports KML
- User → Firmware updates: updates firmware
- Firmware updates → Meshtastic API: fetches releases
- User → NFC sharing: shares by NFC (evidence: `README.md`)
- User → Wi-Fi provisioning: provisions Wi-Fi
- Assistant service → App Functions: routes functions (evidence: `androidApp/src/google/kotlin/org/meshtastic/app/ai/appfunctions/BaseMeshtasticAppFunctionService.kt`)
- App Functions → AI function provider: uses provider (evidence: `androidApp/src/google/kotlin/org/meshtastic/app/ai/appfunctions/BaseMeshtasticAppFunctionService.kt`)
