Sub SendSms(PhoneNumber AsString, Text AsString)
' if smssendallow = true then 'give the option to deny sms text sending in the settings.
Try
Dim ps As PhoneSms '-> Sending sms doesn't work if this is commented out
Dim r As Reflector
r.Target = r.RunStaticMethod("android.telephony.SmsManager", "getDefault", Null, Null)
r.RunMethod4("sendTextMessage", ArrayAs Object(PhoneNumber, Null, Text, Null, Null), _
ArrayAsString("java.lang.String", "java.lang.String", "java.lang.String", _
"android.app.PendingIntent", "android.app.PendingIntent"))
ToastMessageShow("Sent SMS Text to " & PhoneNumber, False)
Catch
Log("Failed to send SMS to " & PhoneNumber)
End Try
End Sub