Send SMS QPython

8.3k views Asked by At

So i am rather new to Q Python and android scripting and i am stuck trying to test out sending text messages. i have done some other simple things. here is my code below. the actual script has my own number in it so i am trying to send a message to my self. I am getting an error saying null pointer exception whenever i run it. any ideas or inputs would be great! I have tried using both the android library and the andoridhelper library.

import androidhelper
droid = androidhelper.Android()
droid.smsSend("123456789", "test")
3

There are 3 answers

3
River On BEST ANSWER

I think QPython doesn't contain the permission of SEND_SMS, maybe you can try it in QPython3.

0
Emm On

Well what I did is to change the lib from android helper to sl4a and then my code looked like this.

import sl4a
droid = sl4a.Android()
droid.smsSend("0044....","sms")

And it worked I think you just have to put your country code before the number to work or the code that the phone is

I also used qpython3

0
Silas S. Brown On

The Play Store version of QPython was updated on 7 March 2019 with the message "remove SMS permission to comply with the newest Google Play policy". If you need that permission you'd better stick with the old version 2.4.2 of QPython or install separately from Play Store.