Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending long sms messages

Tags:

android

I've got an app that lets users send sms messages. Works great when the message < 160 characters. After that, things work less-perfectly. Seems like there are a few options here:

  1. Manually break the message up into multiple SMSs, send each part as a separate SMS.
  2. Use the multi-part send SMS function (sendMultipartTextMessage()).
  3. Send the message as an MMS message (sendDataMessage()?).

Here's my novice take on it:

1) most well supported across carriers. Users may get mad that you just cost them N separate messages though, instead of converting to MMS or something.

2) not sure if this is supported by different carriers, and read that once the message is greater than 3 * 160 chars in length, gets converted to MMS anyway by different SMS apps - maybe stay away from this altogether.

3) not sure how to do this, and older phones might not support MMS. To send an MMS using the android SDK, do we just use the SmsManager.sendDataMessage() method?

Thanks

like image 457
Mark Avatar asked Dec 30 '09 17:12

Mark


People also ask

Can I send SMS more than 160 characters?

What is GSM? When you send an SMS Message longer than 160 characters, the message will be concatenated and split into 153 character chunks. The 1st 7 characters of each message are used to instruct the carriers and your handset to concatenate the message and re-build it into one fluent long message upon delivery.

Do SMS messages have a length limit?

The character limit for a single SMS message is technically 160 characters. However, most modern phones and networks support message concatenation: they split large messages into individual SMS messages (called "segments") and then re-create the large message at the receiving end.

Is it rude to send long text messages?

“Texts are a shorter medium of communication, a little bit like an answering machine message,” says Post Senning. “If it gets too long, the text becomes a burden to the person on the receiving end.” If you have a lot to say, break up the message into several texts, so it's easier for the receiver to read.


1 Answers

This is quite an old post but it's high up on Google when searching for Android multipart sms, so maybe it helps someone.

Regarding part 1 and 2, it's pretty much the same thing. To use sendMultipartTextMessage, you need to break up the long message into an ArrayList of Strings. It then sends as many SMS as needed. In short:

SmsManager sms = SmsManager.getDefault();
ArrayList<String> parts = sms.divideMessage(longMessage);
sms.sendMultipartTextMessage(phoneNumber, null, parts, null, null);

Part 3: MMS is not an option, as it has been pointed out. The charges and all.

like image 92
Valentin Klinghammer Avatar answered Sep 22 '22 04:09

Valentin Klinghammer