I am working on a app which is suppose to capture delivery report for SMS sent by any SMS app in the phone.
I have worked on messaging app that sends and also collects delivery report. It is done by setting pending intent :
PendingIntent deliveredPI = PendingIntent.getBroadcast(this, id, intent_delivery, 0);
and then
registerReceiver(new BroadcastReceiver() {
@Override
public void onReceive(Context arg0, Intent arg1) {
Bundle extras = new Bundle();
extras = arg1.getExtras();
switch (getResultCode()) {
case Activity.RESULT_OK:
notifyMessage("SMS delivered", getBaseContext(), extras.getInt("id"));
break;
case Activity.RESULT_CANCELED:
notifyMessage("SMS not delivered", getBaseContext(), extras.getInt("id"));
break;
default :
notifyMessage("Unable to generate delivery Report", getBaseContext(), extras.getInt("id"));
}
}
}, new IntentFilter(DELIVERED));
But now I want know how to be able to collect SMS sent by any SMS app installed on phone.
Presently I just have an idea of setting a broadcast listner for this purpose but I don't know how to and what kind of broad cast listner to set and the to check for wht parameter. I think i have to check PDU for information but i am not sure. I tried to search the net but i could not find things relevent to my need.
Help me out Thank you.