I am currently writing and application, that is sending/receiving SMS messages.
For unit-testing purposes I need to create PDU programmatically. Decoding is quite easy:
Bundle bundle = intent.getExtras();
if (bundle != null) {
/* Get all messages contained in the Intent*/
Object[] pdusObj = (Object[]) bundle.get("pdus");
for (int i = 0; i < pdusObj.length; i++) {
SmsMessage msg = SmsMessage.createFromPdu((byte[])pdusObj[i]);
}
}
Is there any appropriate way to create PDU programamtically?