I have strange peoblems with sending-receiving sms messages in Android.
I am using standart methods to do it:
SmsManager.getDefault().sendTextMessage(phone, null, message, sentPI, deliveredPI);
(please, don’t say that you are using sendMultipleMessages and all works fine, because there is no difference in these methods thoose can resolve my problem)
Before sending sms I am doing something like this: byte[] b = message.getBytes();
And I have got the following:
-
sending bytes from 1st emulator: [85]
receiving on th 2nd emulator [85] -
sending bytes from 1st emulator: [85, 94]
receiving on th 2nd emulator [85, 94] -
sending bytes from 1st emulator: [85, 94, 87]
receiving on th 2nd emulator [85, 94]!!!!
In other words, sended bytes and received are different or have one or more mismatches!!!
This is a very simple example, only to show where the bug is.
Can anyone who used sending sms test it and post results on his emulator!?
Is this a problem with emulator?
My guess:
The default SMS charset is not the full Ascii spectrum.
According to this page the code
94 ('^')needs to be escaped.