BroadcastReceiver for multipart SMS

a 夏天 提交于 2019-12-01 18:33:55

according to several applications, it seems that multipart SMS are received in the same intent, and that they are represented by the messages array.

so basically, you retrieve the complete message:

StringBuffer content = new StringBuffer();
for (Message sms : messages) {
    content.append(sms.getDisplayMessageBody());
}
String mySmsText = content.toString();

As far as I know, it seems that the messages are in the correct order. Anyway, I don't know of any way to retrieve the message header (except parsing the pdu yourself).

155 chars sounds like the length of the user data when the user data header for a multipart SMS has been taken into account. In other words, it doesn't sound like there is a problem here - the PDU is being stored correctly. You will need to gather the other PDUs for the SMS to display / store the full thing.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!