I am developing an android application that will block incoming sms from specific numbers i have successfully achieved this. The app is working fine in other versions except the version 4.4.4. I have set its periority but nothing worked for me. here is the code for receiver in manifest
<receiver android:name=".msgreceiver"><intent-filter android:priority="1000"><action android:name="android.provider.Telephony.SMS_RECEIVED"/></intent-filter></receiver>
and i am blocking the sms by calling this method in java
this.abortBroadcast();
I search to solve this problem and found that in kitkat the app need to set as default messaging app to abort the msg. But i want to do this programatically. Is there any way to block incoming sms in kitkat programatically???
I search to solve this problem and found that in kitkat the app need to set as default messaging app to abort the msg
That is the case for API Level 19 and higher. At the moment, that is ~60% of Android devices actively using the Play Store.
But i want to do this programatically
You are welcome to ask the user to make your app be the default SMS client, via an ACTION_CHANGE_DEFAULT
Intent
. You cannot force your app to be the default SMS client through the Android SDK, outside of some security flaw.
Is there any way to block incoming sms in kitkat programatically?
Write a full SMS client that has SMS-blocking capabilities.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With