Search code examples
androidsmsmmsrich-communications-services

How does SMS work (with Android devices)?


We are working on a app based on Google's Rich Messaging Platform (RCS) and I'd like to ask some specific questions pertaining to how SMS is delivered into Android devices.

Questions for the matter of understanding:

Are SMS messages delivered into the Android OS or the messaging app?

Are SMS messages being pushed (ie. Push Notifications) into the Android OS or messaging app? If not, is it pulled - and how?

Do MMS work the same way as SMS, in terms of how messages are delivered?

Important Question:

If we are developing an RCS app to replace SMS. Is it possible to deal with receiving SMS directly? That is, interaction with SMS would completely bypass the Android OS and/or another (default) messaging app.

EDIT - added the following questions:

This post says we can listen to incoming SMS/MMS messages. So, here's a question:

Can our app be the only sole app to listen for SMS/MMS messages?

If the answer to the above question is no, then (after the user reads the message on our app), can our app send a message to the other SMS messaging app(s) to remove the batch count and set the message to read?

If our app is NOT using Direct Boot, will SMS/MMS be lost since they cannot be delivered, whether or not our app is the sole SMS/MMS app?

And, this question for the matter of understanding:

From what I understand now is the SMS/MMS are part of the telephony system, while RCS is NOT. Could you confirm my understanding is correct?

Thanks!


Solution

  • To the best of my knowledge, this is how the SMS works on Android:

    Are SMS messages delivered into the Android OS or the messaging app?

    SMS messages are sent to the Android OS as they are part of the telephony/cellular system. They are definitely not pushed to any particular messaging app as the incoming message comes from the cellular provider to the device (aka the OS/firmware) directly. The messaging app a user interacts with is simply a "front" for displaying and interacting with the user to send/show messages at they are received. You can actually change the default messaging app on Android which further demonstrates that SMS is actually part of the OS.

    Are SMS messages being pushed (ie. Push Notifications) into the Android OS or messaging app? If not, is it pulled - and how?

    Much like an incoming phone call, SMS messages are "pushed" to the device but not in the way you may be familiar with like Push Notifications (i.e. GCM). The concept of a Push Notification is something that exists on the IP layer; that is, it's a service that runs on the Internet. The kind of push a device receives for SMS messages is part of the telephony system. This is why, for instance, devices can still receive SMS with mobile data turned off but can't receive notifications for a Facebook message.

    Do MMS work the same way as SMS, in terms of how messages are delivered?

    Yes, they work essentially in the same way as described above except they have some additional protocol for how they handle the data that is received from the cellular network to fetch things like images. The data is still transmitted on this telephony network and not over Internet (for the most part). There are implementations now of MMS that may piggyback off the Internet to fetch and load images quicker but that may be carrier specific.

    If we are developing an RCS app to replace SMS. Is it possible to deal with receiving SMS directly?

    It depends what you intend to do. You won't be able to fundamentally change the SMS protocol on the telephony network as this is not within your control as an application. However, you can create an app to monitor and listen for SMS message as they are received in the OS. You can check out this post on how to do that. If you wanted to create your own RCS, you'd pretty much have to do this over the Internet. Services like WhatsApp have made clever use of combining both telephony SMS and standard Internet messaging to create a seemingly seamless experience. Without further context on what you're trying to build, I won't be able to provide more help.

    In the end, you should just think of native SMS as being part of the phone. For further readings on how SMS works, I suggest the SMS Wikipedia page. I hope I was able to answer some of your questions!