Sending long sms messages

前端 未结 3 1433
误落风尘
误落风尘 2020-12-08 05:25

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 opti

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-08 06:02

    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 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.

提交回复
热议问题