D
D
Dmitry Vavilov2011-08-10 21:16:22
Android
Dmitry Vavilov, 2011-08-10 21:16:22

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

2 answer(s)
A
Anatoly, 2011-08-11
@taliban

Space? Or is it the lack of characters that is critical?

B
bracadabra, 2011-08-15
@bracadabra

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 question

Ask a Question

731 491 924 answers to any question