Interruption of SMS transmission and / or deletion of received SMS from the Inbox folder

I am trying to write an sms encryption tool. People using this tool will be able to communicate without the Internet via sms and remain encrypted. The only thing I need is how to delete sms from a specific number from folder to inbox or delete sms notification and then delete sms from inbox.

I've googled a lot, but this is not working on this StackOverflow question . The broadcast is working, I see a log message that starts the broadcast but does not interrupt the transfer.

Also I found many posts that are not possible. So is it possible and how can I do this? I am using android 2.1 and up. Thanks to

Code (just trying to cancel all sms for testing purposes): Broadcast Receiver:

  @Override
  public void onReceive(Context context, Intent intent)
  {
      abortBroadcast(); }

      

Part of the manifest:

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

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

      

+3


source to share


1 answer


I also need to have BROADCAST_SMS permission. This was my problem. Here is the working part of the manifesto.



<uses-permission android:name="android.permission.BROADCAST_SMS"/>
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
....
 <receiver android:name=".SMSReceiver" android:permission="android.permission.BROADCAST_SMS">
          <intent-filter android:priority="1000">
                <action android:name="android.provider.Telephony.SMS_RECEIVED" />
            </intent-filter>
        </receiver>

      

+2


source







All Articles