In Android 4.4, My App is not an SMS App but it need to send SMS(multiple times).
The thing is that the Sent SMS will be stored in Default SMS App(Hangouts).
It would spam/annoy users a lots. I would like the SMS actions are transparent/silently with End-Users.
AFAIK, we may prevent this by setting my App at the moment I send the SMS & change back later.
But this is not really an option since end-user flow become complicated & may lead to confusion. another reason is Default SMS App may lose the System Broadcast when my App was set as Default SMS App.
Is there complete solution on this?
Thank you for you support.
If i am not wrong.. you want to send sms without storing in default sentitems list..????
The task you mentioning is possible without any confusion in the flow...
This can be done by setting the sentIndent in smsmanager to null.
public final void sendTextMessage (String destinationAddress, String scAddress, String text, PendingIntent sentIntent, PendingIntent deliveryIntent)
This will suppress the sentintent thereby avoiding to store in the default sent items...
There is also a previously discussed question regarding this topic in stackoverflow..
How to send SMS from the Android app without making its record in device SMS view?
Check it out...
If you could share the code u use for sending message.. It would be more easy to help for others...
Related
I’m trying to develop an application to do some manipulation (compression and security matters) on the outgoing Sms regardless of the composer application. The main challenge is that I cannot capture the Sms exactly before being sent. For instance the user compose the message body using Go Sms Pro and when the send button is pressed , right before the sms is actually sent we capture it and do the compression and security matters on .
Any solution or replacement idea appreciated.
Starting with KitKat, the SMS content provider has been opened up (finally): http://developer.android.com/about/versions/android-4.4.html
To make this work with previous versions of android, you could set up a content observer to watch content://sms/, query the appropriate tables in that database, and then do whatever you like to erase the message before it goes out. This is just a thought mind you, but whatever you do will likely involve using this method.
This is not possible, short of via your own custom build of the Android OS. You have no ability to intercept, let alone modify, the calls from an arbitrary app via SmsManager to the OS to send an SMS message.
I can successfully send an SMS using the following code:
public static void SendSMS(String message, String number) {
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(number, null, message, null, null);
}
However, the message appears in the conversation between me and the person I send it to. Due to the nature of the game I am creating, each player receives a "secret message". I don't want the person running my app to know others' "secret message" by checking the Messaging app.
Is there any way to prevent this behavior? The only way I can think of is by deleting the most recent message in the conversation, but I'm not sure how to do that either, and there's probably an easier way.
Edit for clarity: For my game, only one person is running the app. I am broadcasting a "secret message" to each player in the game. The person running the app should not know what those messages are, so they should not appear in the user's Messaging app.
I have written an answer about sending SMS messages here: Send SMS until it is successful
The sender of the message will not see the message anywhere unless it is explicitly displayed by the app that is running the code somwhow. Atleast that is my experience and I have used it for various occasions.
Though I must admit that I am not sure if that is the case for Android 4.4 as I believe they made some changes regarding SMS handling.
From this site: http://thepu.sh/trends/android-kitkat-far-reaching-update-puts-sms-app-developers-notice/
There can only be one default SMS app at any time
If an app is not chosen as the default SMS app, Google wants the developer to disable the option for that app to send a message. If not disabled, any message sent through this non-default app will not be visible in the user’s default SMS app.`
I am attempting to develop an Android application that sends and receives SMS messages (among other things)
i wish to have my apps SMS messages easily identifiable.
I didnt want to use the SMS message body for this unique identifier, i thought there must be an SMS message attribute i can use. sadly i have failed to find one or track down a technical spec for SMS messages in general.
does anyone know if the SMS message standards have an ID field that can be se programmatically?
No, there is not.
You can see the contents of an standard SMS message on page two of this document, and on this page.
The way I have handled this is by setting an SMS listener with a higher priority than the system SMS listener that looks for a unique string in all received texts.
If the SMS contains the string I handle it in the application and discard the SMS so that I do not litter the users inbox.
The users message alert tone doesn't even go off. It works quite well.
See this post for more info on how to do this:
Can we delete an SMS in Android before it reaches the inbox?
i know it's been 4 years . but in case anyone passes through this question.
yes SMS has unique id called _id and you can identify SMS through it.
for more info please refere to this answer.
I've got an idea for an Android Application, however I am unsure if it would work. Essentially what I want to do is "intercept" all text messages sent from any SMS App and make modifications to them.
For example, say I write out the following SMS:
Hi {Name}, how are you today? Can you tell {Boss} I'll be 15 minutes late today.
The onSMSSend function in my application(assuming it is currently running in the background) would then be able to edit the content of the message(Eg. Replacing variables with ones defined in the application), and then send it on to the recipient.
Is Android able to provide this functionality?
No it is not. Android may be able to inform you after an SMS was send. But there is no way to intercept a message that should be sent and apply changes to it on a non rooted phone.
What you could do is to write a new messaging App that allows the user to type a message, choose a number and send the message. Now you have full control over the message that is send but building a replacement for the sms app is a fair amount of work.
in my app i need to be able to send a text message in a background, without users intervention. I am using SmsManager (code below) to accomplish that. It does send a message but the popup asking me to choose a delivery method still shows up (even after the message is sent). I do have Google Voice installed thus the popup. Is there a way for me to avoid displaying this popup while sending text message? Perhaps i shall use a different method?
Thanks!
SmsManager sm = SmsManager.getDefault();
sm.sendTextMessage(number, null, message, null, null);
Update: so just to see what will happen i selected a default delivery method being "text message" and check the box saying use this as default. Now when i send the message using the code above it sends it in the background but it also bring up the empty form to send a message to :| How do i get rid of this? :)
restored the device and problem was gone, so must've been a third party app causing the send new message form, its all good now, sms is being send in a background. thanks for your help all...
I tested that and didn't have that problem. I have Google Voice installed but only use it for voicemail on my main line so maybe thats it. Can I assume you have a separate Voice number? I think this is just an issue of Android not knowing which number to send the text from so you will have to pick a default the first time. Is there the option to set it as the default method? If your intention is the send this text secretly then maybe you might want to rethink your intentions for doing so.