Knowledge Base updated: 2026-11-19
Android SMS Gateway knowledge base
Android SMS Gateway is an Android application that exposes device SMS/MMS capabilities through local and cloud-facing gateway services. Its main parts are application/service orchestration, message processing, cloud synchronization, an embedded HTTP API, webhook delivery, persistent Room storage, and an operational Android UI.
Critical state is stored in the app's Room database and settings/preferences: messages and recipients, gateway/device identity, API credentials, webhook queues, logs, and configuration. Android system services provide telephony, subscriptions, broadcasts, notifications, connectivity, and keystore integration.
flowchart TD
Android[Android platform]
App[Application lifecycle]
UI[Android UI and operations]
Events[Event routing]
DB[(Room persistent storage)]
Config[Configuration management]
Msg[Message processing]
Outbound[Outbound delivery]
Inbound[Inbound SMS/MMS capture]
Cloud[Cloud gateway integration]
Health[Connection and device health]
API[Local HTTP API]
Auth[Local API authentication]
Webhooks[Webhook delivery]
Security[Security and encryption]
Android --> App
Android --> Inbound
Android --> Outbound
App --> Events
App --> Config
App --> UI
Events --> Msg
Events --> Cloud
Events --> Webhooks
Msg --> Outbound
Inbound --> Msg
Msg --> DB
Config --> DB
Cloud --> DB
Health --> Cloud
API --> Auth
API --> Msg
API --> Config
Webhooks --> DB
Security --> DB
UI --> DB
Glossary
- Gateway — the cloud-connected device registration and command channel.
- Local API — the embedded HTTP server exposed by the Android device.
- Recipient state — per-destination delivery state associated with an outgoing message.
- Webhook queue — persisted outbound event deliveries awaiting processing or retry.
- Orchestrator service — background service boundary that coordinates internal events and work.
Invariants
- Persistent gateway and message state must be accessed through the Room database layer, rather than treated as in-memory service state (
app/src/main/java/**/database/**). - Outbound delivery state is tracked per recipient so one destination's result does not overwrite another's (
app/src/main/java/**/message/**). - Embedded-server endpoints must pass through local API authentication and authorization before accessing protected resources (
app/src/main/java/**/server/**). - Webhook deliveries are persisted before asynchronous delivery and retry processing (
app/src/main/java/**/webhook/**). - Android background work is coordinated through application events/services rather than directly coupling UI components to transport work (
app/src/main/java/**/event/**).
Routing table
- app/…/AndroidManifest.xml, app/…/App*.kt,
app/src/main/java/**/service/**-> docs/application-lifecycle.md app/src/main/java/**/event/**,app/src/main/java/**/router/**,app/src/main/java/**/orchestrator/**-> docs/event-routing.mdapp/src/main/java/**/database/**,app/schemas/**-> docs/persistent-storage.mdapp/src/main/java/**/settings/**,app/src/main/java/**/preferences/**,app/src/main/java/**/configuration/**-> docs/configuration-management.mdapp/src/main/java/**/message/**,app/src/main/java/**/messages/**-> docs/message-processing.mdapp/src/main/java/**/message/**/send/**,app/src/main/java/**/worker/**/send/**-> docs/outbound-message-delivery.mdapp/src/main/java/**/receiver/**,app/src/main/java/**/mms/**,app/src/main/java/**/inbox/**-> docs/inbound-sms-mms-capture.mdapp/src/main/java/**/gateway/**,app/src/main/java/**/cloud/**-> docs/cloud-gateway-integration.mdapp/src/main/java/**/gateway/**/worker/**,app/src/main/java/**/cloud/**/worker/**-> docs/gateway-command-workers.mdapp/src/main/java/**/network/**,app/src/main/java/**/health/**,app/src/main/java/**/ping/**-> docs/connection-and-device-health.mdapp/src/main/java/**/server/**,app/src/main/java/**/api/**-> docs/local-http-api.mdapp/src/main/java/**/auth/**,app/src/main/java/**/token/**-> docs/local-api-authentication.mdapp/src/main/java/**/webhook/**-> docs/webhook-delivery.mdapp/src/main/java/**/webhook/**/event/**,app/src/main/java/**/webhook/**/payload/**-> docs/webhook-event-payloads.mdapp/src/main/java/**/security/**,app/src/main/java/**/encryption/**-> docs/security-and-encryption.mdapp/src/main/java/**/identity/**,app/src/main/java/**/key/**-> docs/device-identity-and-key-management.mdapp/src/main/java/**/ui/**,app/src/main/res/layout/**,app/src/main/res/navigation/**-> docs/user-interface-and-operations.mdapp/src/main/java/**/log/**,app/src/main/java/**/logs/**-> docs/operational-logs.mdapp/src/main/java/**/notification/**,app/src/main/java/**/notifications/**-> docs/notifications.md