I’m trying to make an app for my local bus system. They have a service where you can text a 4 digit id of a stop and see when the bus will be there next.
These ID’s are hard to remember, so I’m making an app that has logical names of stops, and when you click them it sends an SMS with the right ID for you.
They then send you an SMS response. I’d like the response to go to my app and be handled there with some parsing and nice GUI stuff. However, the system SMS app gets the text too. I’d rather not have this double response.
Is it possible to have the response directed to my app but not others?
Yes, it is possible.
Firstly, in your manifest you need to set the priority of your receiver to be a very high value:
This makes sure your application receives the SMS first. Then, in your code where you receive and process the SMS, put the following code:
This stops the SMS being sent onto other receivers.