Search code examples
androidsmsgsm

How to get raw SMS bytes on Android?


I know how to retrieve SMS in Android, I get plenty of details such as sender, date, thread_id etc. However, I would like to get raw GSM message (in form of byte array e.g.), that is received by the device.

Is that possible? How to get this?


Solution

  • Try SmsMessage.GetPdu, which returns a byte array.

    The key term to look for is "PDU" = Protocol Data Unit, i.e. the contents of the SMS protocol message that is created when an SMS is sent or received over the network.