I write application which will get data from received SMS. This is data only for application and I dont want to user can read this message. Is possible to consume SMS just after get data from them to prevent user from reading this SMS? Thanks for any help.
You will need a sms receiver see http://davanum.wordpress.com/2007/12/15/android-listen-for-incoming-sms-messages/
Maybe you need also to delete the received sms.
Yes, this is easy to do. See my answer here for how to do this:
SMS receive with no notification
Once you've confirmed that the SMS is one of your special ones, you just need to call abortBroadcast() to stop it going into the user's inbox:
// Stop it being passed to the main Messaging inbox
abortBroadcast();
You should also be aware that the SMS receiver will not intercept SMS messages sent to the user's Google Voice number, as by default those messages will be downloaded over the data connection and displayed by the Google Voice app. If their Google Voice number is configured to forward the SMSs to the phone then those will be handled fine by the SMS receiver.
Related
So i want to write a PoC app for an idea that I have. One of the feature that my app would do is send a text message (and perhaps receive delivery notification). Its not going to be an SMS app. Just a service which might run in the background and sends sms on some particular interval, unattended (of course with user consent).
i remember in some of android api release, Google took the decision that you can only send receive sms if you have selected your app to be "default" sms app ? I don't remember exactly.
So the question is, can my app (as a service) send an sms and receive delivery notification while not being an SMS app ?
Whenever I try to Google this question, I find how to send sms example with SMSManager and the code to send the sms but no where i could find this answer.
So the question is, can my app (as a service) send an sms and receive delivery notification while not being an SMS app ?
Yes. Since KitKat, there has been the concept of a default SMS app, which is what I believe you're referring to.
The main difference in the way SMS are handled as of that version is that only the default SMS app has write access to the Provider, but any other app can still send and receive messages as usual. If your app is not the default, any messages it sends will automatically be written to the Provider by the system.
Furthermore, the SMS_RECEIVED broadcast can no longer be aborted, so you don't have to worry about some other app intercepting incoming messages before your app gets a chance to handle them.
I am new in Android development and I'm doing an SMS app that receives multiple SMSes i.e notification SMS that's captured into the ListView and another SMS that contains the location of the sender for use in displaying the sender's location on google map.I've managed the first part,how do I listen again for the second SMS using the BroadcastReceiver...In other words how to listen for an incoming SMS when multiple different SMSes are expected.
If you impleted correctly the BroadCastReceiver you shouldnt worry about the second time, it would be fired automatically. You should post your code to have more information.
Welcome to Android development!
In order to receive incoming SMS's, you need to use the BroadcastReceiver mechanism that listens to incoming SMS's intent.
But, If you want to be sure that the message is going throw your app before it gets into the System's database, you have to give your BroadcastReceiver's Class a high priority on the manifest.
Good Luck.
Is it possible to receive an email and save it like an sms in android, pretending to be an sms received so a broadcast receiver can intercept it?
There's no malicious intent here.
We have a service where we send alerts to our clients devices(we sell them the devices), but since we have lots of GPRS data available, we would like to use that to send them the alerts whenever something happens related to their assets(cars, boats, etc).
So we send an email to the device via GPRS and our app would intercept it, convert it to an SMS so our app on the device could intercept it(already does that for SMS alerts) and open a map and do some other stuff.
So nothing illegal going on here.
thanks.
Is it possible that i can get Notification when Handset sends SMS and get the receiver's Number before the SMS is sent. I used BroadcasrReceiver to get notification of Incoming Message.But in same way i am not able to track outgoing SMS message by using "android.provider.Telephony.SMS_SENT"
Please Help....Thanks in advance.
I dont think such is possible, once the phone has granted the application the permission to send SMS, there is little or nothing you can do about it as the user.
I am developing the app which holds the messages in it's own inbox rather than the native inbox.
This can be achieved only if the incoming messages are prevented from reaching the native inbox.
There is some attribute android:priority in <intent-filter>, by which message can be first received by current receiver than others.
But I do not know how to do it properly, does anyone know?
I assume you mean SMS messages? The best, and only AFAIK, is to receive the message via registering the proper BroadcastReceiver object, copying the message into your database, marking it is read in the SMS ContentProvider and then deleting it from the SMS ContentProvider. Check out this article on how to receive SMS messages and then check out this SO post on how to use the SMS content provider.
Edit I actually stand corrected, there is another method that I've had sometimes limited success with. In the BroadcastReceiver you can call the abortBroadcast() method to cancel the broadcast. The important thing here is that you register your receiver with an intent filter that has a higher priority (say, 100) so that it receives the SMS before anybody else does.