Hi,
I wrote an app called Backseat Buddy which is used during driving and I've been using it for bloody ages, and one of the things it does is to reply to incoming messages while I'm driving. Recently I noticed it had stopped working. My first thought was that in another app of mine called Turn Me On, in which I recently implemented an auto reply facility, was receiving the messages instead but BB was reading out the messages so this meant BB should be replying to them. Anyway, I've gone into the debugger and done some tests and BB is definitely running the code that sends the replies. The number and message are both correct. Here is the code.
This code has been in there for a very long time and working fine. It is still going through the motions but no messages are being sent. The autoreply code in TMO is ripped off from BB and does actually work. I can tell TMO to reply to incoming messages and it does so perfectly, and BB even reads them out! BB goes through the motions of sending the messages but nothing arrives back to me or is even logged in the Messages app.
My permissions are correct with
so I'm at a loss as to why the exact same code in one app runs perfectly, but it is executed but ignored in the other app.
Any ideas?
Richard
I wrote an app called Backseat Buddy which is used during driving and I've been using it for bloody ages, and one of the things it does is to reply to incoming messages while I'm driving. Recently I noticed it had stopped working. My first thought was that in another app of mine called Turn Me On, in which I recently implemented an auto reply facility, was receiving the messages instead but BB was reading out the messages so this meant BB should be replying to them. Anyway, I've gone into the debugger and done some tests and BB is definitely running the code that sends the replies. The number and message are both correct. Here is the code.
B4X:
Sub SendSMS(number As String, Message As String)
Try
Dim r As Reflector
r.Target = r.RunStaticMethod("android.telephony.SmsManager", "getDefault", Null, Null)
r.RunMethod4("sendTextMessage", Array As Object(number, Null, Message, Null, Null), _
Array As String("java.lang.String", "java.lang.String", "java.lang.String", _
"android.app.PendingIntent", "android.app.PendingIntent")) 'Dim i As Intent
Catch
Log(LastException.Message)
End Try
End Sub
This code has been in there for a very long time and working fine. It is still going through the motions but no messages are being sent. The autoreply code in TMO is ripped off from BB and does actually work. I can tell TMO to reply to incoming messages and it does so perfectly, and BB even reads them out! BB goes through the motions of sending the messages but nothing arrives back to me or is even logged in the Messages app.
My permissions are correct with
B4X:
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.READ_SMS"/>
<uses-permission android:name="android.permission.RECIEVE_SMS"/>
so I'm at a loss as to why the exact same code in one app runs perfectly, but it is executed but ignored in the other app.
Any ideas?
Richard