tags:

views:

522

answers:

2

Hi,

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

+1  A: 

seems to me that the first option is what most mobile phones do by default. sms messages by design can only send a certain amount of characters (160 probbaly), just inform the user that the message is too big and if he still wants to send it anyway (informing also how many sms would the total be).

as for MMS and multipart as you said not every carrier supports it, so they dont seem to be the best option.

EDIT: as for how does MMS work on android-sdk check this thread out: http://stackoverflow.com/questions/1914456/android-sdk-mms

sap
I agree. An alert notifying that the message is too long and will have to be sent as n text messages with an accept/cancel option seems like the best choice to me.
Vian Esterhuizen
Ok makes sense, thanks all.
Mark
What country are you in? I would be surprised to hear of carriers that don't support multipart SMS messages. I live in the UK and it's been nearly ten years since I last had a phone that didn't understand multipart SMS. I would doubt that many regular phones convert long SMS messages into an MMS (e.g. here I get free SMS, but MMS costs me money to send).
Christopher
A: 

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.

Quelltextfabrik