Check the SMS Order in Android - android

I'm sending 5 messages via android SmsManager and need to check the delivery order. Are the SMSs that are sent in an order delivered in the same order or not. If not, what is the order of delivery?
I think I can do it by BroadcastReceiver to check the delivery but how about the order?
Thanks

Related

Can I send an SMS from a service?

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.

SMS BroadcastReceiver for multiple SMS in android

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.

Android and consume SMS

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.

Send SMS on Android to itself

I need to write a service that translate short messages obtain from JSON and transform it to a SMS. Is it possible for an Android service to send itself SMS? If so, which lib or api?
(In some way, fake SMS.)
The only way you have to get an SMS in the inbox is to send a regular message to the own phone number (you may incur in two sms charges, so be careful on how you use it).

How to prevent incoming messages by reaching the native inbox in android?

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.

Categories

Resources