0

Is that possible to have a SMS app, that can block some kind of sms (i.e. where text contains "XYZ" phrase). But i Don't want it to be set as a default sms app.

I've seen something like this, but dont know if that can do the task : https://github.com/tuenti/SmsRadar

closed as off-topic by eldarerathis Mar 31 '18 at 17:20

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about writing and publishing Android apps, writing custom ROMs, and other topics that are primarily of concern to developers are off-topic. Consider taking advantage of other resources that may be appropriate for your question." – eldarerathis
If this question can be reworded to fit the rules in the help center, please edit the question.

1

This isn't possible as of Android KitKat (4.4). Only the default SMS app is able to stop the broadcast of the SMS message to the other apps.

That said, since Android N, you should be able to use blocking to block SMS and Calls from a particular telephone number using Android N Call Blocking.

https://www.digitaltrends.com/mobile/how-to-block-a-number-in-android/

Note that some Carriers/OEMs may actually disable this blocking feature or make it harder to get to.

There is a ContentProvider and API starting in Android N that would allow apps to programmatically block calls and texts, you need to either be the default SMS or phone app, a system app, or be a carrier app. While becoming a default app is something the user would allow you to do, but only carrier approved apps could become carrier apps.

https://developer.android.com/reference/android/provider/BlockedNumberContract.html#AUTHORITY_URI

  • 1
    thanks. btw, i am not interested at all in the blocking sms or calls from number. I wanted programaticall way to block sms containing the specific string. – T.Todua Mar 31 '18 at 15:35
  • Updated with Android N Blocking API info. To block am SMS with a specific string content you'd have to be the default app. Because you would need to check the contents and make a decision as to wether or not to allow the SMS to propagate through the system. – DataDino Mar 31 '18 at 16:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.