Android Question sendMultimediaMessage

MarcoRome

Expert
Licensed User
Longtime User
Hi All.
I'm trying to send an MMS with the sendMultimediaMessage method. But it does not work.
with this method is possible send MMS without Intent ( API level 21 )
The code seems correct:

B4X:
Sub SendMMS(PhoneNumber As String, dir As String, Filename As String)
    Dim ctxt As JavaObject
    ctxt.InitializeContext
    Dim sm As JavaObject
    sm = sm.InitializeStatic("android.telephony.SmsManager").RunMethod("getDefault", Null)
    'Dim uri1 As Object = CreateUri("file://" & File.Combine(dir, Filename))
    Dim uri1 As Object  = CreateUri("file://" & File.Combine(File.DirRootExternal, "foto3.jpg"))
    Try
        Log("Sended..")
        sm.RunMethod("sendMultimediaMessage", Array(ctxt, uri1, PhoneNumber, Null, Null))
    Catch
        Log(LastException)
    End Try
End Sub


Documentation HERE

upload_2017-5-11_13-16-22.png


Any idea ?
Thank you
 

MarcoRome

Expert
Licensed User
Longtime User
I read in unfiltered:
[SendRequest@35b88dc] HTTP or network I/O failure
com.android.mms.service.exception.MmsHttpException: Invalid URL http://[13]
at com.android.mms.service.MmsHttpClient.execute(MmsHttpClient.java:207)
at com.android.mms.service.SendRequest.doHttp(SendRequest.java:83)
at com.android.mms.service.MmsRequest.execute(MmsRequest.java:171)
at com.android.mms.service.MmsService$2.run(MmsService.java:414)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:762)
Caused by: java.net.MalformedURLException: no protocol: +3933433670XX
at java.net.URL.<init>(URL.java:589)
at java.net.URL.<init>(URL.java:486)
at java.net.URL.<init>(URL.java:435)
at com.android.mms.service.MmsHttpClient.execute(MmsHttpClient.java:124)
... 6 more

Seem that error is here:
Caused by: java.net.MalformedURLException: no protocol: +3933433670XX
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
The error seems to be

[SendRequest@35b88dc] updateDestinationAddress: can't parse input PDU
[SendRequest@35b88dc] HTTP: POST http://[13], proxy=213.230.130.89:80, PDU size=8906
[SendRequest@35b88dc] HTTP: invalid URL http://[13]
java.net.MalformedURLException: no protocol: +xxxxxxxxx
at java.net.URL.<init>(URL.java:589)
at java.net.URL.<init>(URL.java:486)
at java.net.URL.<init>(URL.java:435)
at com.android.mms.service.MmsHttpClient.execute(MmsHttpClient.java:124)
at com.android.mms.service.SendRequest.doHttp(SendRequest.java:83)
at com.android.mms.service.MmsRequest.execute(MmsRequest.java:171)
at com.android.mms.service.MmsService$2.run(MmsService.java:414)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:762)
 
Last edited:
Upvote 0

udg

Expert
Licensed User
Longtime User
I will wait your MMS
.. and some late night phone calls, if that's your real phone number..eheh
 
Upvote 0
Top