The story of SimGate (https://simgate.app)
SMS is still one of the most reliable ways to send notifications,
alerts, and verification codes.
But if you've ever looked at services like Twilio, you know the costs
can add up quickly --- especially for small projects, internal tools, or
experiments.
So I started wondering:
What if a regular Android phone could act as an SMS gateway?
Turns out... it can.
Recently I built a small system that turns an Android phone into a
programmable SMS API.
The idea
Every Android phone already has:
- a SIM card
- an SMS modem
- an internet connection
So instead of paying for SMS infrastructure, the phone itself can send
messages.
The missing piece is just connecting that phone to a backend.
The architecture looks like this:
Your App
│
▼
REST API
│
▼
WebSocket connection
│
▼
Android phone
│
▼
Carrier SMS network
Your backend sends a request → the phone receives it → the phone sends
the SMS.
The architecture
The system has three main parts.
1. Backend API
The backend exposes a simple endpoint:
POST /send-sms
Example request:
{
"to": "+381601234567",
"message": "Hello from API"
}
The backend does not send SMS directly. Instead it forwards the message
to a connected device over WebSocket.
2. Persistent device connection
When the Android app starts, it opens a WebSocket connection to the
backend.
Example:
socket.emit("connectDevice", {
deviceId: "abc123"
});
Now the backend knows that this specific phone is online.
Whenever a new SMS request arrives, the backend pushes the message to
that device.
3. Android SMS sender
The Android app receives the message and sends it using the native SMS
manager.
On Android this is surprisingly simple:
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(phoneNumber, null, message, null, null);
That's it.
The phone sends the SMS through the carrier network just like any normal
message.
Why this is interesting
This approach has some interesting advantages.
No SMS provider required
You don't need Twilio, Nexmo, or other gateways.
The SIM card in the phone handles everything.
Extremely cheap
If you already have:
- a spare Android phone
- a SIM card with SMS included
Then your cost is basically zero.
Useful for internal tools
This setup works well for things like:
- server alerts
- IoT notifications
- internal automation
- dev experiments
- sending messages in regions where SMS APIs are limited
Challenges I ran into
This was not completely trivial.
Some problems that needed solving:
Persistent connectivity
Phones disconnect from networks frequently.
Keeping a reliable WebSocket connection required retry logic and
heartbeat checks.
Device registration
Each phone needs a unique identity so the backend knows where to route
SMS messages.
I solved this by generating a device ID during registration and pairing
it with the API key.
Background restrictions
Android can aggressively kill background processes.
The app needs to run as a foreground service to stay alive reliably.
Example workflow
Once everything is connected, sending SMS looks like this.
Example request:
curl https://api.example.com/send-sms -H "Authorization: Bearer API_KEY" -H "Content-Type: application/json" -d '{
"to": "+381601234567",
"message": "Server is back online"
}'
The connected phone immediately sends the SMS.
Why I built this
Originally this started as an experiment to see if it was possible to
build a simple SMS gateway using commodity hardware.
After getting it working, I turned it into a small service called
SimGate that lets you connect a phone and send SMS through an API.
The idea is simple:
Phone + SIM → SMS API
If you're curious or want to try it:
I'd also love to hear how other people handle SMS in small projects or
internal tooling.
Are you using:
- Twilio
- self-hosted GSM modems
- Android devices
- something else entirely?
Top comments (0)