0

i've read this and this in order to make this script

import sl4a

droid = sl4a.Android()

msgs = droid.smsGetMessageIds(False, 'sent')[1]
msgs.extend(droid.smsGetMessageIds(False,'sent')[1])

print(droid.smsGetMessageById(msgs[0], ['address','body','status','error_code']).result)
droid.smsDeleteMessage(msgs[0])

My purpose is delete last sms sent. But it does not works. That answer does not work for me. Even if is not my default sms client i can send sms, but i can't delete these sms after sending. What is the problem?

Community
  • 1
  • 1
linuxer
  • 161
  • 1
  • 9
  • If you're running on API 4.4 (KitKat) or above, your app has to be the default SMS app to be able to delete messages, as explained [here](http://stackoverflow.com/questions/20158998/marking-sms-messages-as-read-unread-or-deleting-messages-not-working-in-kitkat). – Mike M. Jun 01 '16 at 08:47
  • That answer does not work for me. Even if is not my default sms client i can send sms, but i can't delete these sms after sending – linuxer Jun 01 '16 at 09:02
  • Your app doesn't have to be the default app just to send messages. It just can't delete them if it's not the default, because it doesn't have write access to the Provider. Any app can still send messages. – Mike M. Jun 01 '16 at 09:04
  • So there is no way with a python script, right? – linuxer Jun 01 '16 at 09:12
  • I really doubt it, though I'm not at all familiar with sl4a. Even if you could, though, I doubt the user would want to temporarily switch their default app just to run your script. – Mike M. Jun 01 '16 at 09:16

0 Answers0