9/22/2013

Mark Unread Sms As Read Thoroughly via Tasker

For quite some time, I use a task to mark unread sms as read programmatically via Tasker. But these method worked not so effectively.

Firstly, I adopt the database-process-directly way. With a specific SQL syntax, I can mark all unread sms as read. Like this:

Run Shell [ Command: sqlite3 /data/data/com.android.providers.telephony/databases/mmssms.db "update sms set read=1 where read=0" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: Continue Task After Error:On ]

Yes, it mark the unread sms as read. But it can’t refresh the unread count in “Messaging” app. And it can’t clear the unread notification in notification bar.


Then I tried the “SL4A+Python” method(refer here). Yes, it can mark unread sms as read and reset the unread count in “Messaging App”. But it can’t clear the unread notification too.


With the “SL4A+Python” method, we made a step forward. But it’s not very perfect. As for notification problem, I had looked up some information. It’s not allowed to clear notification of other app programmatically in android. The notification can be cleared by the tapping of user or by the app itself. We will be taken to the main window of app when we tapped the specific notification normally. And it seems not to be a friendly way. So we can consider about the other way. But app will not clear its notification at our sweet will. I’ve been stuck here for a long time.

Until recently, the principle behind "Launch Camera App" inspired me to try to do something similar about the package of "Messaging" app.



I tried it and it proves me right on MIUI 3.9.6. Now I can mark unread sms as read thoroughly via Tasker! Here is the flowchart:


More: Clear An App's Notification

8 comments:

  1. How about using Compose SMS, wait 1 sec and Go Home. Works for non rooted devices. Limitations: Sender has to be in contacts.

    I have a time triggered sending sms to my provider, waiting for the response (4 messages) with time remaining info for my program (splitters and values used on Zooper Widget). So I wanted to erase those messages from SPECIFIC sender (cell povider) which I added on contacts, and then added those 3 commands to the end of the splitting task. Works like a charm.

    Chris from Greece :D

    ReplyDelete