Remove All Ads from XDA

Anyone have experience with SMS handling within Android?

1,019 posts
Thanks Meter: 157
By Dishe, Senior Member on 22nd May 2017, 03:07 AM
Post Reply Email Thread
I'm trying to solve a problem for Google Voice users, and looking to pick the brain of someone who may know a thing or two about how Android handles SMS, particularly how an app can be set to be the "default" for messaging.

What is my goal, you ask?
Make it possible for Android users to default all new messages from their Google Voice number, rather than the carrier. Yes, you can just remember to initiate a message inside the Google Voice app, but when responding to a missed call or clicking on message from a contacts screen, it will open the system's default SMS app and send from the carrier number instead. Confusion often ensues when the recipient doesn't recognize the number. We're trying to avoid that, as many of us GV fans use it as our primary number and don't know or care what the carrier # is. In other words, we want to avoid sending from the carrier if at all possible.

But doesn't Hangouts do this already?
It did. While Hangouts supported SMS, we could set it as the default app and then tell it to use Google Voice as the default for all new messages (rather than the carrier). This worked pretty well... anywhere in the OS that you want to initiate a message (call log, contacts screen, etc), it would open hangouts screen with GV as the sending service. But now that they are killing SMS support in Hangouts, it seems they are also removing the ability for it to be the default for all messages. They're actively pushing users to switch to another app for SMS, and you can't set it as the default currently unless you install an older version first. Eventually it will probably stop working altogether.

Why not just set the Google Voice app as the default for messaging?

It seems Google does not want us to be able to do that. The app does not have the option to. I'm wondering if it is because it doesn't actually support carrier SMS messages, and perhaps that would create a conflict in OS experience design? I'm not sure.

What is your proposed solution? Making a new SMS app from scratch is a lot of work, and Google's third party support for Google Voice is very limited...
I understand. Realistically, what I'm wondering is, would it be feasible to create a very simple forwarding app. In other words, a small third party app that could be set as the default for messaging, which could just forward the new message request to another app? Google Voice shows up as an option to send messages from other screens, such sharing an image or link. Heck, so does Hangouts (which will still support Google Voice integration, just not the ability to be the default app). The problem is when initiating a text from the dialer, contacts, or call log, it doesn't give us a context menu to choose from. It only goes to the default app. What I want is the ability to intercept that request and then choose the app to default to ourselves! Preferably the Voice app, but even Hangouts would be acceptable... or if possible let the users decide!

Possible pitfalls are
1) Do apps that support being set as default messaging require being able to actually handle carrier SMS? I could understand if that was a requirement from a UX design perspective, but is it actually an OS limitation or is it possible? I recall hearing once that the FB messenger app supports being set as default for messaging, but I don't understand how that could work, and I haven't found reference to it yet (don't use FB messenger personally).
2) If the Android OS would allow it, would it actually break carrier SMS? I know setting Hangouts to be the default moves all carrier SMS into Hangouts, and if switching to another app it would move the messages to that one. If my proposed forwarding app works, would carrier SMS messages just go nowhere? Occasionally the carrier does send a service announcement or bill reminder, etc, and I think it might be important for those to go somewhere. Or maybe not... I'm not sure how the OS handles this.
3)When a request for a new SMS is made, is the request done in a way that can be re-parsed for another app to handle? I really can't find much or any documentation on how this is handled, but I know the information is out there since Android supports third party SMS apps.

I have had trouble finding documentation about how any of this works from a developer's perspective, so I'm hoping someone where could shed some light on whether or not my idea is dead in the water before I pour too much effort into trying to figure this out. Thanks!
The Following User Says Thank You to Dishe For This Useful Post: [ View ] Gift Dishe Ad-Free
22nd May 2017, 07:37 AM |#2  
Dishe's Avatar
OP Senior Member
Thanks Meter: 157
Did a little digging after I posted this and found some info on some dev forums elsewhere.
Seems, as I feared, that in order for an app to be supported as "default" for messaging, the requirement is that it include the handlers for SMS/MMS. This appears to be because whatever app is set as default for messaging is the app that is responsible for receiving and storing said messages. So if my app proposed above were simply to forward messages to another app, and not actually handle carrier SMS/MMS at all, any messages that DO actually come in from the carrier (notifications, payments and outages, etc, which I get from time to time) wouldn't go ANYWHERE and cause a great big user experience flaw.

So that answers some of my question. The next bit is... can incoming messages be forwarded to another app, such as the Android Messaging app that they are trying to make the new standard? Then perhaps this idea could still work. It might make more sense for a pre-existing Messaging app to simply support forwarding to google voice on new messages (or heck, Google should add GV support to Messaging), but I'm not sure how realistic that will be.
The Following User Says Thank You to Dishe For This Useful Post: [ View ] Gift Dishe Ad-Free
17th September 2017, 12:14 AM |#3  
Junior Member
Thanks Meter: 5
I've been thinking about this problem for a while, too. Both Hangouts (for those who have GV linked to it) and the GVoice app probably still have specialized intents to receive message data, so that they can forward them along; the key is to find out what to send to these apps.

I see the problem as only one-way: basically, capturing SMS intents as the default messaging app, then sending the user either to the message-entry screen in the target app (GV/Hangouts) or sending the message directly if that was in the intent. And I thought that there might be a less hair-pulling way to do it, by creating a messaging "shim" app:

* Use an existing, plain vanilla SMS app as a basis. For instance, just pull the one from AOSP. In addition to the new functions below, it will take care of carrier SMS.
* Offer a setting to choose where outbound SMS goes by default: in-app (carrier), GV, Hangouts, etc.
* Add a screen banner saying something like "Carrier SMS" or showing the carrier's phone number.
* If the default outbound app is not in-app for carrier messaging, add a screen icon for jumping into that default-messaging app set by the user.

In this simplified setup, there's no need to handle _inbound_ SMS via GV/Hangouts at all -- because that app will pop up its own notifications, and jump into its own app when its notifications are tapped. Similarly, notifications raised by this customized SMS app, from carrier SMS, would go into that app. No special logic required for any of this, simplifies things a lot.

The end goal from a UI perspective would be, _if_ the user chose a default outbound app other than this one, then the following behaviors would be received by this app and forwarded along to the target outbound SMS app:

* selecting the SMS icon for a contact would, via this app, open GV/Hangouts with that number ready for message entry;
* sending a fully formed SMS via any app, e.g. voice entry via Google App or Assistant, would be forwarded to GV/Hangouts for immediate sending.

(EDIT TL;DR: The problem, distilled, is how to make *initiating a new message from elsewhere* use the real desired app; the desired app will handle it from there.)

The UI problem here is that it will be sort of a "dummy" SMS app. It will handle carrier messages, but there will be people who don't even get carrier messages (FreedomPop comes to mind), so it's another app icon to ignore. Still, it would be the fastest path to resolution and, for most users, would act as a "shim" between native SMS handling and GV/Hangouts (or maybe even other messaging apps?).

---------- Post added at 07:14 PM ---------- Previous post was at 07:11 PM ----------

FWIW, I do understand Android development, though I'm totally green on UI elements. So if you already have some technical know-how here, I'm happy to collaborate to help make this happen. I think this would be soooo much better than having to shove in Xposed (which slows down Lollipop and later) and use XVoice++.
The Following User Says Thank You to duh_org For This Useful Post: [ View ] Gift duh_org Ad-Free
19th April 2018, 08:45 PM |#4  
Junior Member
Flag lahore
Thanks Meter: 1
i have just started developing on android. am a new bee with very little knowledge. i have read you post and it had given me some food for thoughts for my messaging app. i liked your idea and wanted to know about your progress. i want to collaborate in your project if you are interested.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes