0

I have a default SMS messenger Android app that will receive binary and plain text messages. I need to determine if the received SMS is in binary or text to know how to send a message back to the original sender.

On 5.1 I can check the MessageBody for null. Null means it's binary. On 5.1.1 I don't see the same results. The MessageBody has junk from incorrect encoding. I receive the error messageBody is other binary data format encodingType=2 In the console.

Is there another way to determine if a SmsMessage is binary?

Thanks

DarthVadar123451
  • 619
  • 1
  • 6
  • 14
  • Encoding type 2 means its binary (in some cases also 4). Check for encoding type parameter if you have it, which will tell you what kind of message is (e.g. 0 is gsm 7bit, 3 is latin1, 8 is ucs2(utf16) etc – Marvin Jun 18 '17 at 00:54
  • SMPP v3.4 specs, section 5.2.19 data_coding – gfunk Jun 19 '17 at 21:34

0 Answers0