0

I want to write an SL4A script to mark Unread SMS of inbox as Read. I want to run this script in QPython android application.

​import androidhelper as android
droid = android.Android()
ids = droid.smsGetMessageIds(True).result
print type(ids)
print ids
number = droid.smsMarkMessageRead(ids, True).result
print number

Code This is same as above.

Output

  • What's the output you expected to get? For now, the question is really unclear. Does it work on other android versions? – Aemyl Jul 28 '17 at 12:15
  • I want 9 as the value of number variable. and I've not tested in other Android versions. – Hitesh Salavi Jul 28 '17 at 12:28
  • I tested it now on android5 (`linux-armv7l`) with QPython3 (python version 3.2.2) and I also get zero as value of `number`. So this seems to be not android / qpython / python version related – Aemyl Jul 28 '17 at 12:45
  • Hey **Aemyl**, It may not be a version related issue. But that is not the concern even. I ultimately want a script which can _Mark unread SMS as Read_. – Hitesh Salavi Jul 28 '17 at 13:14
  • yes, I tried to figure out what the problem with your code is and I only figured out what is _not_ the problem. But I wanted you to know that. When you know more, it's more likely you can fix it one day ;) – Aemyl Jul 28 '17 at 13:18

1 Answers1

0

Google maybe has disabled general application being granted WRITE_SMS permission in newer android system (maybe >= M) , so the smsMarkMessageRead may not work.

I answered on https://www.facebook.com/groups/qpython/permalink/1410128472397009/

Just read the post's comments.

River
  • 206
  • 1
  • 4