jolabs jolabs
← All posts

Engineering · SMSWire

Sending SMS from Android phones: what we learned building SMSWire

Why we built an SMS API on ordinary Android phones, and what it took to make it dependable. Connections, carrier limits, two SIMs, failover and privacy.

By Yosef Worku · November 2026 · 2 min read

In many countries, sending an SMS from your app is harder than it should be. You sign a contract with an aggregator, register a sender name, wait, and then pay for every message. In some places there is no self-serve option at all.

An Android phone with a SIM can already send texts, and a SIM bundle is cheap. SMSWire turns that phone into an SMS API: your app makes one HTTPS request and the phone sends the message. This is what we learned while making that dependable.

The phone calls the server, never the other way round

A phone on mobile data or home Wi-Fi has no public address, so a server cannot reach it. Each phone therefore opens a WebSocket to our server and keeps it open. Messages are pushed down that connection.

This has a second benefit. When the phone drops off the network, messages wait in a queue on the server and go out when it returns. The app that sent them never needs to know.

Android limits how fast you can send

Android stops apps from sending too many texts in a short time. In practice one SIM sends about 30 SMS parts a minute, and a long message is several parts. The gateway app paces itself under that limit.

We state the limit in the documentation instead of hiding it. A login code arrives in seconds. A campaign to thousands of people has to be planned over hours, or spread across more phones.

Two SIMs, one conversation

Many phones have two SIMs, and the gateway can take turns between them to spread the load. That created a problem we did not expect. A customer gets one text from one number and the next text from another, and then replies to the wrong thread.

So each person now stays on the SIM that last texted them, and only new recipients take turns. It is a small rule, and people see one number instead of two.

Phones fail, so plan for it

Phones run out of battery, lose signal and get restarted. A project can have a backup phone. If the main phone is offline for a minute, waiting messages move to the backup and the owner gets an alert. Status updates keep arriving on the same webhook, so the calling app sees nothing unusual.

The phone is personal, so forward as little as possible

The phone in the drawer is still somebody’s phone. It receives bank codes and personal texts, and none of that is our business.

The app forwards only replies from numbers your project texted in the last 30 days, plus messages that match a join keyword you set up. Everything else stays on the phone. The Android app is open source, so anyone can check this for themselves.

What we would tell another team

Three rules shaped most of the decisions above:

  1. Design for the device going away.
  2. Say what the limits are, in the documentation and in the product.
  3. Treat anything that lives on a personal device as private by default.

If your product needs SMS, payments or other integrations built in, we can help.

Have a project like this?

Tell us what you need. We reply within one working day.

Start a project