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.
Related
sorry fo my complete ignorance developing an Android.
I'm asking about the feaseability of this pseudocode I would like to implement as native app; let imagine a task that:
when a specific SMS arrive (only those sent from a specific sender number)
possibly (multi-SMS in case of text bigger than 160 chars )
elaborate/format each received SMS:
. save text content on a local db
. print text on a bluetooth printer
. reply to sender with some sort of "ACK" SMS
BTW, what above could be sort of background task, and I would need on foreground a sort of user interface that visualizes received SMS and do some user actions (sending back SMS to sender)
Is all that possible on Android ? Any issue ?
I mean, above all: is possible to "catch" specific SMSs (by example those sent by a specific sender number), living unalterated the usual SMS workflow for ALL other SMSs ?
Sorry for my beginner question and Thanks for your patience
giorgio
www.giorgiorobino.com
Following this link to implement a BroadcastReceiver that will listen for incoming SMS.
Inside your onReceive from your BroadcastReceiver, handle your logic (print/save/..)
It is possible, yes. But not recommended. That being said the way to set this up is to catch the SMS intent, so your app would be started when an SMS is received. Otherwise it would not run at all (as long as you don't have any other interface open). For a code example on the message interception part, see this post. For the database part look up local storage on android phones. Look up on SMS messaging for the reply. Not sure how bluetooth printing would work as I've never done it, but if it's a standard protocol I'm sure there's either built in support or a library for it.
can anyone help me to intercept the incoming Flash messages (specially the ones from the telecom company, where they send our current balance after some activity like message sent).
My application deals with sending SMSes in bulk and I don't want the flash message popping now and then. So is it possible on Android ?
EDIT: Everyone says its not possible above Android 1.6 but I found a similar App on Google Play but I want the source of that kind of App. Please Help.
Edit: More than a year has passed and still I didnt got the solution. Can anyone help to resolve this thread..??
Might depend on the channel [of communication] used by your service provider. I guess they don't use SMS, probably they use WAP/PUSH or some pre-installed provider app for the notifications, which makes this harder to block. If it was SMS, you'd definitely have lots of ways to block their notifications, but in this case, I doubt there might be an easy / direct way to do this.
Flight Mode should ideally block telco / service-provider messages / notifications, but then this also blocks your connectivity, right? So, am not so certain on this one. Isn't there a way to opt-out of service provider notifications, maybe via a ussd routine? I've heard of this once...
Flash sms it is the same as usual sms except data coding flags. It has "class 0" indication in DCS.
For details about sms coding see: GSM 3.38 specification / 4 SMS Data Coding Scheme.
Some fragment from spec about it
When a mobile terminated message is class 0 and the MS has the capability of displaying short messages, the MS shall display the message immediately and send an acknowledgement to the SC when the message has successfully reached the MS irrespective of whether there is memory available in the SIM or ME. The message shall not be automatically stored in the SIM or ME.
So, in most cases, phone just displays this message and skips usual chain of actions.
Probably, you can't catch this message with usual API... probably you need deep hook and rooted device.
[Or may be just switch off this service by calling customer support?]
In a certain situation, I'd like my app to be able to "fake" an incoming SMS on the user's device, as a sort of notification. This would save me money when I'd normally use Twilio to send a text to my users but I know they already have my app. Is there any way to do this? I imagine it would have something to do with Intents and Content Providers but I don't really know where to start.
To clarify:
I'm not new to Android and I do respect all of the normal Notification methods. However, my app will have an opt-in for text messages and I'd like to be able to trigger them for free rather than paying for it. This is for SMS-specific uses and not as a substitute for a normal Notification.
Yes (although I really don't support doing this) it is, in theory possible by creating and broadcasting the proper intent. Specifically, they android.provider.Telephony.SMS_RECEIVED intent will be received by anybody who is listening for SMS messages, including the default SMS application. This will in turn cause the notification to be displayed.
All of that said, I've only ever done this in a custom version of Android from within the system process. I'm really not sure if a generic application can do this (in fact, I kinda doubt it). The other caveat is that you will need to formulate your data into PDU's which represent the binary data format of an SMS message. You can look this up, but it's nontrivial.
A far better approach would be to simply have your application display a notification in the tray, the way well behaved applications are supposed to notify the users of events. Take a look at the Notification class.
If you install the apk named ApiDemos-debug.apk that usually comes installed with your choosen platform for the SDK, you will find an example in
<Api Demos> > App > Notification > IncomingMessage
the complete source for this package is usually under
<SDK root>/samples/android-xx/ApiDemos
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.
Is there a way to send messages directly from application to application? I'm making an app that needs verification from another phone, but I only send the messages via SMS, so there is a big chance that a false message having the same format might end up being recognized by the application as a legit one.
I don't think it's possible. For functionality like this you would usually use server, and, maybe Google Cloud2Device to send Push messages.
If both phones are in close proximity to each other, you could make a bluetooth connection and transfer the data that way. It would work like that Bump app that transfers files when the phones are bumped together.
As a work around to the way you are doing it now, you could do a simple encryption of the messages so that they are not plain text and won't match a real text message. If you wanted to make it pretty, you could encode the data in a picture so it doesn't look like a garbage text to the end user.