Chatterbox Part 14 — SMS application for android the hacky way

This is the fourteenth part of the Chatterbox series. For your convenience you can find other parts in the table of contents in Part 1 – Origins

Let’s say that you want to implement an SMS application for Android to support your own platform. Sounds easy but in fact is pretty hard. There are tons of edge cases for handling text messages, pictures, MMS-es, gifs. It’s actually surprising that there is no single API for taking care of them, you need to handle these scenarios manually. I remember when I was trying out various SMS apps and most of them couldn’t handle receiving MMS without data connection and then downloading it later when internet connectivity is back.

And then comes another problem. Let’s say that you implemented such an app and it works. You either developed your own or forked Silence or QKSMS. However, what about your Android watch? Are you going to implement yet another app?

The problem with Android is that only one application can be allowed to read and write SMS messages so if you choose your own app as a default for the phone then you can’t use other apps on the watch. Is there a way to get past that easily?

One trick I could think of is with Automate and SimpleHttpServer. Automate can subscribe for notifications when a message is received or sent.

You implement two flows: first reacts when a message is received and writes it to a file. Second does the same for sent messages.

Next, you implement a trivial webpage which read the file and does something with it. Since it’s HTML, you can implement literally anything and develop it much easier than a full-blown android application.

How do you send a message from the browser? You use the following link:

This will open your default SMS application and you just need to hit a button to send the message.

What about your watch? You need to connect to the web server exposed by your phone and you have your app ready.