Intercepting Outgoing SMS

GaiusSensei picture GaiusSensei · Sep 26, 2011 · Viewed 23.8k times · Source

Is it possible to intercept outgoing SMS before it is actually sent, get its contents then ignore / send it according to some criteria?

eg. block all international text (numbers with leading 00), but allow everything else.

Answer

Vineet Shukla picture Vineet Shukla · Oct 17, 2011

Incoming SMS

You can intercept an incoming sms thru sms listener using Broadcast receiver.You can modify the incoming sms or destroy it so that it does not reaches inbox.

Outgoing SMS

You can listen for outgoing sms by putting content observer over content://sms/out but you can not modify it with the native sms app.You can obviously modify the content of content://sms/out but it has no point.