Android SMS Timer - android

Ok guys, I need the brightest minds on this. I am still a novice prorammer for android, but I have been asked to try to creat an app that will allow users to delay the send of their Text Messages.
I.E. when app is running, and I send a message it does not send right away but waits for a minute or two and then asks if you really want to send it; like a verification.
I am not asking for code, but for references which will allow me to read and then construct the code. Is such a service feasible?
Here is what the app needs to access:
SMS service ( to prevent outgoing SMS until ready)
Contact ( for whitelist)
Ringtones on the phone.
thanks for the help.

Rather than override the regular workings of Android's SMS service you should create your own SMS app that sends messages after a timed delay and user approval. The code for sending SMS from Android is trivial:
SmsManager sm = SmsManager.getDefault();
String number = "6508570720";
sm.sendTextMessage(number, null, "Test SMS Message", null, null);
The delay would be only a little bit more difficult and easily handled with a timer. And getting the contacts is also simple.

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.

Send SMS without the SMS appearing in the Messaging app?

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.`

Is there any BroadCast Activity/services for sending an SMS?

i want to goes through some condition statement when a user hit a "send sms" button and thus if condition is satisfied then send the sms otherwise abort the composed sms !
can any one help me ?
No there is not broad cast activity to use it when sms is going to send,
This is not possible. Any application can use SmsManager to send an SMS, and such messages cannot be intercepted, except perhaps by custom firmware.
You can't block an outgoing sms. You can find out about it only after it has been sent. And you can do it by registering a content observer for sms, when the sms comes to sent box.
It is good question, when you are working by using any builten application in android, then it gives you some facility upto some extent, but you can't cross the limit.
If You want to control the send button of builten apps then it is impossible. You can't do this in android.

sending SMS per app in android - is there any technical difference to sending manually?

I have an app which sends normal text SMS to a device to turn it on or off.
I just use the normal sms method:
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(phoneNumber, null, message, sentPI, deliveredPI);
In hundred of cases the SMS sent by the App do exactly the same as sending SMS manually. However, I have one user who claims, that sending SMS manually has a different effect than sending the SMS from within the app. In fact he claims that with the App the device does not function while sending SMS manually works. What is even stranger is the fact, that the device responds in both cases with a confirmation SMS.
Is that technically possible? Are there any special technical settings that one could change in Android phones when sending SMS? I really can't imagine that there can even be a difference.
many thanks for all your hints
I think you're trying to solve this other way around.
If device sends a confirmation SMS but doesn't function as expected, you probably want the logs from the device.
The actual answer: No. SMS application is using the same API.

Android programming auto sms

I have an application which sends an auto SMS when I receive an SMS, or missed cal etc. So, if the same application is there in the opposite person's phone, then the the process of sending SMS continues, which should not happen. How to avoid this?
In fact, how to detect an SMS, which is sent by user or auto replied?
Please try to explain programmatically as clearly as possible..
SmsManager sm = SmsManager.getDefault();
sm.sendTextMessage(phoneno, null,"sam", null, null);

Categories

Resources