Answer the question
In order to leave comments, you need to log in
Android API: how to send empty sms with delivery report requirement?
Hello. I'm new to android coding. Killed the evening, did not find a way to resolve the issue.
Can you tell me how can I send an empty SMS requesting a delivery report?
Now
only this without delivery report.
And the problem is that you need to send an empty SMS. And if I replace "Test Message" with null or "", then the application crashes when sent.
Thank you in advance.
SmsManager sm = SmsManager.getDefault();
sm.sendTextMessage(phoneNo, null, "Test Message", null, null);
Answer the question
In order to leave comments, you need to log in
In the sendTextMessage method, there is such a check , so you can’t just send an empty message.
if (TextUtils.isEmpty(text)) {
throw new IllegalArgumentException("Invalid message body");
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question