Challenge
We wanted an Android SMS gateway of our own for mailing our client list, because the usual route did not fit. In Uzbekistan that route is an SMS aggregator: a contract with a provider and a charge for every message. It makes sense for steady notification traffic. For a modest list and occasional mailings it is heavy, and the contact list ends up on someone else's server.
The brief followed from that. Messages leave from an ordinary Android phone with an ordinary SIM card, control sits on a computer, and the contacts never leave that computer. The program also had to refuse the wrong sends: a duplicate, a number on the stop list, or a mailing with no consent recorded.
Solution
The web dashboard runs locally: Python and FastAPI, with the data in a SQLite file on the same disk. The phone itself becomes the Android SMS gateway: it connects over USB and runs an open-source gateway app, which takes commands from the dashboard and sends each SMS through Android's own messaging stack. We did not write our own APK, since the existing gateway already does that part well.
Sending is single-threaded on purpose. One message is in flight at a time, and the next one goes only after the phone answers and a short pause has passed. That costs some speed. In return the phone stays under Android's built-in limit on outgoing SMS, and when the cable drops it is obvious which message the run stopped on.
Every attempt is written to the database before the command reaches the phone, so resubmitting after a failure never gives the same person a second SMS.
Architecture and implementation
What the dashboard does:
· imports a CSV or XLSX list, normalises numbers, drops duplicates and invalid entries, and estimates SMS parts per text
· skips every number on the stop list, whether it was added by hand or from a file
· sends from the SIM you pick, at that SIM's own tariff
· will not start without the consent checkbox, or while the phone has Wi-Fi switched on
· pauses or stops at any moment, and holds promotional messages to a 9:00 to 18:00 window
· reports delivery per number, reconciles statuses after a lost connection, queues a second round for undelivered messages, and exports results to XLSX and CSV
Contacts and mailing history stay on the computer running the dashboard and are not uploaded to a cloud.
Result
The program took one working day. The project was opened in the early afternoon, and on the same day it passed QA acceptance and a security audit. 242 automated tests cover the code. A test SMS from the phone reached its recipient within five seconds.
For a client, the useful part is what sits behind that. If your CRM or back office needs to send SMS, we can connect a phone or a gateway to it and follow each message all the way to a delivery report. Lost connections, retries and status tracking have already been worked through once, and the tests hold them in place.
The base version costs $250: we install the program as it is, without changes, and set up your phone. Changes for your own workflow are quoted separately.
Gallery