1
  1. As of android 4.3 the programatically sent sms is working fine, but 4.4.4 programatically sent sms is also copied to native inbox - how to handle this issue.

  2. How to stop an sms from going to inbox or delete sms in android 4.4.4 and above

eebbesen
  • 5,070
  • 8
  • 48
  • 70

1 Answers1

2

Starting with Android 4.4, any non-default SMS app using SmsManager to send messages will have them automatically written to the Provider by the system. There is really no way to prevent this, other than your app being the default SMS app. The default app is responsible for writing its own outgoing messages to the Provider, and it can opt not to do so. The case is the same for incoming SMS messages; if your app is not the default SMS app, it really doesn't have any control over whether an incoming message is written to the Provider. This link describes what is necessary for an app to be able to act as a default SMS app.

Getting Your SMS Apps Ready for KitKat

That said, I do have a workaround that allows a non-default app write access to the Provider, but only for Android 4.4; it does not work (yet) in Android 5.0 or above. With this, it would be possible to delete both incoming and outgoing messages, but only after they've been written.

Community
  • 1
  • 1
Mike M.
  • 38,532
  • 8
  • 99
  • 95
  • I have handled deletion of nativs SMS using this link on stackoverflow https://stackoverflow.com/questions/27697282/android-kitkat-api-19-how-to-write-messages-in-sms-content-provider-without/27709655 . It's working fine in android 4.4.4 but it's failing in android lollipop due to permission issue, can anybody has a solution to make it work in lollipop as well. Thanks in advance – Ramesh Paladugu Jun 02 '15 at 06:28