Introducing a new way to review your PRs.

Read the announcement

capcom6 / android-sms-gateway

The SMS Gateway for Android™ app enables sending and receiving SMS messages through an API that can be accessed directly on the device or via a cloud server when direct device access is not possible.

View on GitHub

20 documents · Updated Nov 20, 2026

overview

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