0

I have been trying to send a text message using sl4a in qpython

Here is my code:

import androidhelper

droid = androidhelper.Android()
droid.smsSend('phone number in here', 'message in here')

When I run it, nothing happens

Does anyone know why?

Malice
  • 1,457
  • 16
  • 32

3 Answers3

0

Looks like the source code of sl4a's sms facade is here: https://github.com/damonkohler/sl4a/blob/master/android/Common/src/com/googlecode/android_scripting/facade/SmsFacade.java

And the class it uses was deprecated long long ago. Android documentation is here: https://developer.android.com/reference/android/telephony/gsm/SmsManager.html

According to the documentation, the old class only works on GSM. I think that's why it works on virtual machines, but not on a real device(maybe CDMA). An older similar question without answer is here: how to resove smsSend() error in sl4a python

Kirk
  • 446
  • 4
  • 18
0

I have the same problem when I use Qpython.

But in old Qpython3(py3.2), I can use sl4a.Android module to send message.

Something like this:

import sl4a 
droid = sl4a.Android()
droid.smsSend("0044....","sms")                       
Xi Jin
  • 1
0

You need to use the android module as shown below with qpython3 :

from android import Android
droid = Android()

droid.smsSend("number", "msg")
סטנלי גרונן
  • 2,917
  • 23
  • 46
  • 68