Parsing SMS PDU

Barmaley picture Barmaley · Apr 14, 2011 · Viewed 9.1k times · Source

Seems to be that I need to parse PDU byte array received during SMS BroadcastReceiver:

@Override
public void onReceive(Context context, Intent intent) 
{ 
    Bundle bundle = intent.getExtras();
    Object[] pdus = (Object[]) bundle.get("pdus");
}

Can someone point me how to do it?

I know that PDUs can be handled using SmsMessage.createFromPdu((byte[]) pdus[i]) but it's not what I'm looking for. I need more precise control over pdu bytes.

Answer

Barmaley picture Barmaley · May 22, 2011

I have found solution - there's nice Java and dot NET library (under Apache license), which handles all PDU related stuff - parsing and so on. It's SMSLib