How can I code in Android such that my app can analyze an incoming SMS and perhaps block it or do something(maybe move to a different SMS folder) BEFORE the SMS actually rai
I use this code, as a BroadcastReceiver:
public void onReceive(Context context, Intent intent)
{
//this stops notifications to others
this.abortBroadcast();
//---get the SMS message passed in---
Bundle bundle = intent.getExtras();
SmsMessage[] msgs = null;
String str = "";
if (bundle != null)
{
//---retrieve the SMS message received---
Object[] pdus = (Object[]) bundle.get("pdus");
msgs = new SmsMessage[pdus.length];
for (int i=0; i
remember to add it in manifest and add a higgest priority (100) for broadcast or sms will go first to inbox and get the alert notification.
Hope it helps you.