UCS-2 エンコーディングをいじらずにクラス 0 の SMS を送信する方法を探しています。
Androidのスレッドクラス 0 SMS (フラッシュ SMS)の回答は、通常のテキストは適切に送受信されるため、UCS-2 エンコーディングをいじっているように見えますが、UCS-2 エンコーディングを必要とする言語はジャンク文字として表示されます。
IE
送信時、
どちらの場合も、 受信されます。
両方、[スレッドの 2 番目の回答、stackoverflow.com/a/9424185/3082310]
byte[] encodedMessage = pdus.encodedMessage;
// byte[0] = mtiByte
// byte[1] = TP Message Reference
// byte[2] = length of source phone
// byte[3..length] = phone
// protocol identifier
int msgLen = encodedMessage[2] / 2;
// +2 -> length of source phone
// +2 -> for 91 after the length
// +1 -> TP PID
int indexTPDCS = msgLen + 5;
byte TPDCS = encodedMessage[indexTPDCS];
byte[] changedMessage = encodedMessage.clone();
// Set bit 4 to 1 using OR (|), indicating there is a message class
// Set bit 0 and 1 to 0 using AND (&), indicating class 0
byte newTPDCS = (byte) ((TPDCS | 0x10) & 0xFC); // Flash SMS
changedMessage[indexTPDCS] = newTPDCS; // Class 0
そして、[ZeroSMS、github.com/virtualabs/ZeroSMS]
/* change class to Class 0 *
int size;
size = (int)pdus.encodedMessage[2];
size = (size/2) + (size%2);
pdus.encodedMessage[size+5] = (byte)0xF0;
同じ結果が得られるようです。
問題がどこにあるのかについてのアイデアはありますか?