I have an application where I make use of SMS manager to send the sms from my app but it is recoreded in the default sms app of the user.I want to either delete the sms from default sms app or restrict the sms recorded in the default app.Any help will be appreciated
1 Answers
Deleting SMS is restricted and can be done only by default messaging app from Kitkat.
Please visit SMS Provider change in Kitkat for more details
Android 4.4 introduces new semantics for receiving messages and writing to the provider. When a message is received, the system routes it directly to the user's default messaging app using the new SMS_DELIVER intent. Other apps can still listen for incoming messages using the SMS_RECEIVED intent. Also, the system now allows only the default app to write message data to the provider, although other apps can read at any time. Apps that are not the user's default can still send messages — the system handles writing those messages to the provider on behalf of the app, so that users can see them in the default app.
If you still want to achieve it. You will have to write your own messaging app and ask user to set it as default sms provider on the device. Below Kitkat it can be done using following code.
context.getContentResolver().delete(
Uri.parse("content://sms/" + id), null, null);

- 6,591
- 5
- 43
- 66