Android programming auto sms - android

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);

Related

How to send scheduled SMS messages in Android?

I have to create an app which has some Mobile numbers in its database. It has to send SMS to everyone one of the number in the database at 12:00 AM everyday. I know how to add the numbers in database. But I don't know how to send scheduled messages for all those numbers. Any helps please?
Use alarmmanager to schedual a call to a method which fetch no. from your database and send your desired message to that number.
From android docs:
AlarmManager:This class provides access to the system alarm services. These allow you to schedule your application to be run at some point in the future. When an alarm goes off, the Intent that had been registered for it is broadcast by the system, automatically starting the target application if it is not already running.
Use SmsManager to send sms
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(phoneNo, null, message, null, null);
And use alarm manager to do it every day
Look at this tutorial for more detail:
http://www.tutorialspoint.com/android/android_sending_sms.htm
http://javatechig.com/android/repeat-alarm-example-in-android

Prevent sms from going to outbox

I am making an app that sends an SMS programmatically.
I don't want it to pop up in the built in SMS app.
Incoming SMS doesn't matter for now.
Is there a way to prevent an sms from going to the 'outbox'?
This is how I send:
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(phoneNumber, null, message, sentPI, deliveredPI);
After KitKat, no. See the post here: http://android-developers.blogspot.com/2013/10/getting-your-sms-apps-ready-for-kitkat.html
Before KitKat, it won't go to the "Outbox" so it isn't an issue.
You can try a third-party solution like www.superdupersms.com (that's the only one I know of, and I'm a part of the development team).

detect the application that sent sms in android

I'm new to android Develpoment
my first application is ant-spy
I try to detect the application that sent sms (that is listening to send an sms )
I ask you to help me this application and if possible give me a source code for DECT application waiting to send sms or a code that resemble.
Thanks.
This code is used to send sms:
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(smsNumberToSend, null, smsTextToSend, null, null);

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 SMS Timer

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.

Categories

Resources