guest86
guest86

Reputation: 2956

Changing text of Android sms

I want to create a censorship app for Android. Idea is that service would "listen" for "SMS_RECIVED" broadcast, and when new sms arrives, it would change some parts of it before system sms app receive it. How can i change text of incoming sms message? Is there any example?

EDIT: What do you think about this: After receiving sms broadcast, my app would search SMS INBOX database for unread messages and then change sms text directly in database. Does it sound better?

Upvotes: 8

Views: 5372

Answers (1)

Aleadam
Aleadam

Reputation: 40381

You can intercept the message and cancel it based on a particular filter, but you won't be able to change the text body.

The text body is stored in the class com.android.internal.telephony.SmsMessageBase, so you do not have direct access to it through the public API. You might get access to it through reflection.

Upvotes: 4

Related Questions