Skip to content
~sami-ullah

Own product

SimRelay — Android SMS Gateway Using Your Own SIM

SimRelay is a small Android app I built that turns my own phone into an SMS gateway. It checks a web server for pending messages, sends each one as a normal text from the phone's SIM card, and reports the sent and delivered status back, so a small web app can send booking confirmations without a paid SMS provider.

Overview#

SimRelay is an Android app that lets a web application send text messages through an ordinary phone. The server keeps a queue of messages, for example booking confirmations. The phone picks them up, sends each one from its own SIM card and tells the server whether it was sent and delivered.

There is no SMS provider in the middle and no third-party backend. It is the server, the phone and the SIM. The app is meant to be installed on your own device, not published to an app store.

My role#

I designed and built the whole app: the polling service, the SMS layer, the settings and onboarding screens, the send log, and the release build setup. I also built the server side that it talks to in my own booking projects.

The problem#

Small businesses often want SMS confirmations for bookings, but paid SMS gateways add a cost per message and extra setup. These businesses already have a phone with a SIM that can send texts.

The missing piece was a reliable bridge: something that takes messages from a web app and sends them through that phone, without the owner having to keep an app open or watch it.

Approach & architecture#

The phone pulls work rather than the server pushing it. That keeps the setup simple: the phone does not need a public address, and it works on any mobile or Wi-Fi connection.

◆ Architecture
  1. Web appthen
  2. adds message to its pending queue
  1. SimRelay (foreground service)then
  2. polls serverthen
  3. receives pending messages
  1. SimRelaythen
  2. sends each SMS from the selected SIMthen
  3. waits for sent / delivered reports
  1. SimRelaythen
  2. posts status back to serverthen
  3. server updates its records

The app runs as an Android foreground service, so it keeps working after the screen is off or the app is closed, and it starts again after a reboot. Long messages and Urdu text are split and sent as multipart SMS. On dual-SIM phones the user picks which SIM to send from.

I kept the app small on purpose. It uses Jetpack Compose with Material 3 for the interface, coroutines for background work and DataStore for settings, but no large networking, database or dependency injection libraries.

Key challenges#

Android tries hard to stop background apps. Battery savers, especially on some manufacturers' phones, kill services they think are idle. I handled this with a proper foreground service and an onboarding flow that walks the user through battery and autostart settings, plus the extra permission step newer Android versions require for sideloaded apps.

Never sending a message twice. If the network drops after a text is sent but before the status reaches the server, the next poll could return the same message. The app remembers which messages it has already handled, so retries never produce a duplicate SMS.

Protecting the SIM. Sending many texts quickly can get a SIM flagged as spam. The app has a rate limit and a delay between messages, and it backs off when the server or network is failing instead of hammering it.

Keeping the key safe. The server key is stored encrypted on the device, and the send log shows what happened without exposing it.

Tech stack#

  • Kotlin with Jetpack Compose and Material 3, including dark mode and a live send log.
  • Kotlin Coroutines for the polling loop and backoff.
  • Jetpack DataStore for settings, and Android's SMS APIs for multipart sending and delivery reports.
  • A plain HTTP client against a small REST contract that any server can implement. I use it with NestJS back ends.

Results#

SimRelay is built and released as a signed APK (version 1.1). It is the SMS channel for my dental clinic booking system, where it sends booking confirmations with a personal booking link, and the salon booking marketplace I built uses it as its first SMS provider.

Screenshots#

Screenshots of the app will be added soon.

Skills used

  • Screenshot of Clinic Booking Systemlive demo

    Concept project

    Clinic Booking System

    Book a slot in your time zone, race two bookings for one slot, then drag appointments in the admin calendar and watch overlaps fail.

    TypeScriptReact.jsNext.jszod
    ▶ Open demo
  • Own product

    AI Outbound Calling and Lead Qualification System

    A system I built that calls a list of consented contacts with an AI voice agent, holds a short qualifying conversation and records every result as a tracked outcome or lead. A NestJS API runs the dialing, compliance checks and webhooks, and a Next.js dashboard with a built-in AI assistant lets the owner run campaigns and ask for reports in plain language.

    NestJSTypeScriptPrismaSQLite
  • Screenshot of Salon Booking Marketplace — Multi-Salon Platform

    Own product

    Salon Booking Marketplace — Multi-Salon Platform

    A multi-salon booking marketplace I designed and built for Pakistan. Clients find nearby salons on a map, choose a barber, service and time, and book at the salon or as a home visit. Salons run staff, schedules and earnings from their own dashboard, and the platform collects a commission per completed booking through daily settlements.

    Next.jsReact.jsTypeScriptTailwind CSS