Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8183695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:14:34+00:00 2026-06-07T01:14:34+00:00

I am working on a sms blocker application, in which i am using broadcast

  • 0

I am working on a sms blocker application, in which i am using broadcast receiver and abortBroadcast() method – as many ppl have suggested here – to prevent messages from reaching inbox and alerting the user. But in my case, when I send a sms using the emulator, the SMS message won’t get blocked, and reaches the inbox, also I get an error :

06-29 09:19:05.854: E/BroadcastReceiver(868): BroadcastReceiver trying to return result during a non-ordered broadcast

which doesn’t terminate the app in the emulator, however the application gets terminated when I test it on my phone.

And yes, I have set the receiver’s priority to a high number and asked for the permissions as you see here:

<receiver android:name="SMSMonitor">  
    <intent-filter android:priority="9999999">
        <action android:name="android.provider.Telephony.SMS_RECEIVED"></action> 
    </intent-filter>  
</receiver>

<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.RAISED_THREAD_PRIORITY"/>

Finally, here’s my code:

public class SMSMonitor extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        boolean isOn = loadState(context,"isOn");// is blocking enabled?
        Bundle bundle = intent.getExtras();
        Object messages[] = (Object[]) bundle.get("pdus");
        SmsMessage smsMessage[] = new SmsMessage[messages.length];
        String mAddress;
        String mBody;
        String mTime;
        if(isOn){
            // if spam blocking is enabled.
            for (int n = 0; n < messages.length; n++) {
                smsMessage[n] = SmsMessage.createFromPdu((byte[]) messages[n]);
                mAddress=smsMessage[n].getDisplayOriginatingAddress().toString();

                mBody=smsMessage[n].getDisplayMessageBody().toString();

                mTime=getTime();
                if(isBlackList( mAddress)== true) {
                    this.addLog(mAddress, mBody, mTime);
                    abortBroadcast();
                    Toast.makeText(context,"Incoming SMS was blocked and logged.", Toast.LENGTH_LONG).show();  
                }
            }
        }
    }
}

Some one suggested here that the SMS broadcasts can’t be aborted because Android won’t allow it. But I have seen many guys here suggested using abortBroadcast() to block a sms, and also I know some SMS blocker apps on the market that actually CAN block SMSs. I don’t know if they are using abortbroadcast or not.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T01:14:35+00:00Added an answer on June 7, 2026 at 1:14 am

    “As of Android 1.6, incoming SMS message broadcasts (android.provider.Telephony.SMS_RECEIVED) are delivered as an “ordered broadcast” — meaning that you can tell the system which components should receive the broadcast first.” and I am using Android 1.5 And the broadcast is non-ordered!

    Thanks to this guy here link

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on sms application in android in which user have to input
I'm working on an SMS Application for Android, which undoubtedly needs to send SMSes
I am working on a android application which read the sms from content provider.
I m working on application in which i have to send all contacts from
Working on a data collection application using mobile sms. when a customer send a
Basically I have a working application that sends an SMS after receiving an SMS.
I have an application which should watching incoming SMS (scan SMS text and show
I am working on a simple application in which I need send sms programmatically
I have a project I'm working on that requires our WPF application read SMS
i have been working on an sms application and i want to provide some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.