开发者

Composed SMS is not received the same at recepients end

I compose a long开发者_JAVA百科 SMS as below:

$$$$$...$$$$$#####...#####*****...*****

There are 160 $ signs which make up my 1st SMS , 146 # signs to compose 2nd SMS & 153 * signs to compose the 3rd message, all exact as per my compose message activity.

I send this long SMS (made up of 3 SMSes) over the network.

I do a small change - After dividing the long sms using SmsManager.divide(), I append [1/3], [2/3] & [3/3] to distinguish them at recepients end.

To my surprise some of the characters of the first SMS i.e '$' are received as a part of 2nd SMS at the receivers end. What I receive is this:

[1/3]$$$...$$$
[2/3]$$$$$$$####..######
[3/3]****..*****

Why did the 7 $ signs get shifted from the first to the last SMS?

Rest of the second and third SMS is fine. Can anyone explain the reason for this?

This was related to GSM. Will it be different in case of CDMA handset?


I don't know about Android specifically, but I don't find that behaviour suprising:

SmsManager.divideMessage() splits the message in parts so that each part on its own can be sent (i.e. each part except the last will be at biggest possible size, or possibly near that).

Then you add some text to each part, making it longer. Consequently the "parts" you specify no longer fit into a single SMS and the separation needs to be redone.


I haven't done any Android development so can't specifically comment on the functions you're using but this looks like it's caused by splitting the message into multiple parts.

When sending long SMS messages some binary headers are added to each part allowing the receving phone to piece it back together in the correct order.

This user data header (UDH) is generally 6 bytes long (it can be 7) removing 6 bytes worth of space from your message. A single part can normally contain 160 characters (140 bytes at 7 bits per character) removing these 6 UDH bytes drops this down to 153 characters.

In your 3 part message the 7 characters (6 bytes) no longer fit in your first part so the Android SMS functions move them in to the second.

If you'd like a more detailed explanation of how concatenated messages work take a look at this blog post written by one of my colleagues http://www.mediaburst.co.uk/blog/concatenated-sms/.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜