Is it possible to create/send SMS using voice commands in Android Auto? I'm not seeing anything about it in the docs at https://developer.android.com/training/auto/messaging/index.html
I have an HTC 10 and when the stock HTC "Messages" app is set as the default, I can tap the mic and say something like "Text Alice" or "Send a message to Bob" and it will then prompt me for the message, listen, and then send it. Similarly, if I set the Android Messages app (from Google) as my default SMS application, it works fine.
Lately I have been using Signal as my default messaging app. I cannot initiate a message via Signal. If I'm using Android Auto and I say "Text Bob" it will send an SMS, but it does NOT send a Signal message even though it's the default SMS app. Instead, it will send it through the HTC Messages app even though it's not the default.
Looking at their code, they have implemented the ANDROID_AUTO_HEARD and ANDROID_AUTO_REPLY intents as mentioned in the documentation. See lines 485-497 of https://github.com/WhisperSystems/Signal-Android/blob/master/AndroidManifest.xml and then the 2 Android Auto notification handlers at https://github.com/WhisperSystems/Signal-Android/tree/master/src/org/thoughtcrime/securesms/notifications
There doesn't seem to be any sort of ANDROID_AUTO_SEND intent or anything of that sort.
Is it possible to add an intent (to Signal) to make Android Auto send SMS through it instead of the other apps? I don't understand why it isn't using Signal when it's set as the default messaging app on my phone. The Android Messages app handles this properly. Is that just because Google put some special code into that app that third-party developers aren't allowed to use?
Related
I want to create an app for Wear OS to replace the default Messages app for handling SMS/MMS messages. To start with, my app will get messages from the phone, relying on the phone to communicate with the cellular carrier. What does my replacement app need to do to send and receive SMS/MMS messages from the phone?
Can my app communicate with the default Google messaging app on the phone (so I don't have to write a phone app too)? Is that protocol/API documented somewhere?
Does my app need to register with the watch to become the default message handler and disable the default app? If so, how do I do that?
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!
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!
In accordance with the doc:
Note that—beginning with Android 4.4—any attempt by your app to abort
the SMS_RECEIVED_ACTION broadcast will be ignored so all apps
interested have the chance to receive it.
so, only default SMS app can do it and looks like nothing is changed with Android 5.0 (due to unknown reason, according issue is marked as Obsolete).
Is there any way to block incoming SMS for non-default SMS app if phone is rooted (this is is needed for spam-blocking app)? How to do it?
You could write a service that overrides CarrierMessagingService .
If the bind to this is successful , then the message is not delivered to the main app.
BIND_CARRIER_MESSAGING_SERVICE permission required to register as carrier messaging service requires the app to be system app. So you need to push your app to the system.
Make your app the default SMS provider. Then it can register for SMS_DELIVER_ACTION. In that receiver, you can choose to either write the SMS to the database or not. If you choose not to, the SMS is basically ignored. If you choose to, any other app can receive the SMS.
You can try the following solution:
Iterate through list of packages capable of handling SMS and disable them programmatically.
To get an API to disable an app you will have to become an MDM(Mobile Device Management) partner app.OEMs provides additional APIs to their MDM partner apps to control the device.For example samsung provides api to disable specific app.I guess they also have APIs to control permission of specific apps.
Alternatively I guess the new android Device/Profile Owner mode must have an API to disable specific apps.
I am developing an android application in which my application send some message which have some specific codes and these codes used to operate my device. And my device is not phone it's an another custom hardware device (Developed an another hardware which is used to control other hardware such as AC/Cooler etc).
Now problem is that whenever my application send any SMS this is shown in SMS default application (O.S 5.0 or greater). While in my phone O.S. 4.2 these sent SMS not shown. And that's what I want. These specific codes should not shown to any one.
I know this is some API change android have done in SDK but there is any solution to overcome from this problem.
only solution for this problem can be "Delete the sms from Sent folder/table of SMS database."
But on or after Android 4.0, Deletion from SMS database is not allowed by public apps. SMS deletion not allowed
As of android 4.3 the programatically sent sms is working fine, but 4.4.4 programatically sent sms is also copied to native inbox - how to handle this issue.
How to stop an sms from going to inbox or delete sms in android 4.4.4 and above
Starting with Android 4.4, any non-default SMS app using SmsManager to send messages will have them automatically written to the Provider by the system. There is really no way to prevent this, other than your app being the default SMS app. The default app is responsible for writing its own outgoing messages to the Provider, and it can opt not to do so. The case is the same for incoming SMS messages; if your app is not the default SMS app, it really doesn't have any control over whether an incoming message is written to the Provider. This link describes what is necessary for an app to be able to act as a default SMS app.
Getting Your SMS Apps Ready for KitKat
That said, I do have a workaround that allows a non-default app write access to the Provider, but only for Android 4.4; it does not work (yet) in Android 5.0 or above. With this, it would be possible to delete both incoming and outgoing messages, but only after they've been written.