Hi,
I'm trying to send an MMS (just a picture) automatically from a driving app I've written. I already send text messages with this code:
I found this code which I thought was for sending an image (Data() contains the byte image returned by the Camera class).
But it doesn't work so it's obviously not what it was intended for. How can I send an image automatically through SMS/MMS without any further user intervention?
Thanks,
Richard
I'm trying to send an MMS (just a picture) automatically from a driving app I've written. I already send text messages with this code:
B4X:
Try
Dim r As Reflector
r.Target = r.RunStaticMethod("android.telephony.SmsManager", "getDefault", Null, Null)
r.RunMethod4("sendTextMessage", Array As Object(NumberToMessage, Null, MessageToSend, Null, Null), _
Array As String("java.lang.String", "java.lang.String", "java.lang.String", _
"android.app.PendingIntent", "android.app.PendingIntent"))
Catch
Log(LastException.Message)
End Try
I found this code which I thought was for sending an image (Data() contains the byte image returned by the Camera class).
B4X:
Try
Dim sm As JavaObject
sm = sm.InitializeStatic("android.telephony.SmsManager").RunMethod("getDefault", Null)
Dim port As Short = 90
sm.RunMethod("sendDataMessage", Array(NumberToMessage, "", port, Data, Null, Null))
Catch
Log(LastException.Message)
End Try
But it doesn't work so it's obviously not what it was intended for. How can I send an image automatically through SMS/MMS without any further user intervention?
Thanks,
Richard