Monday, March 14, 2011

how to send a MMS programmatically in Android

Last couple of day I have been researching on how to send a MMS in android without using Intents, to be honest it is not an easy task and help on Google is limited on this case.

However, one post on stackoverflow.com which helped me immensely.

http://stackoverflow.com/questions/2972845/i-want-send-image-through-using-mms-in-android/2973016#2973016

it seems to be author has looked into the android MMS source code and provided vital information on how to send a MMS. For me, being a rookie hooking up all the MMS code in my project seems to be a nightmare.

When i further look, I found a nice library called "jmmslib" here

which can be directly used in Android to create a MMS but in my cause i found it not to be working very well because sometimes it works, sometime not. (may be something wrong with my code) but it was giving me a hard time and had to look for a better solution.

Then, I found a Nokia Java based MMS impelmentation. You can found it here

you can download the my source code here.
https://github.com/kakopappa/AndroidMMS


Update - 2013-09-17

I just saw TextSecure app is sending MMS messages.. You can find the code here

You guys can use http://androidshell.io/ to connect to remote android devices

96 comments:

  1. I have tested this code on G1 as well as on HTC Desire it works fine, but when i tried it on Samsung Galaxy, it gives an error 503 : Service not found error. I am still investigating

    ReplyDelete
    Replies
    1. SendMMS3.zip
      www.virustotal.com:

      Agnitum Adware.Generic!Pdv2DLWLN68
      AntiVir ADWARE/Adware.Gen
      Avast Win32:InstalleRex-H [PUP]
      AVG AdInstaller.P
      DrWeb Adware.Downware.980
      ESET-NOD32 Win32/InstalleRex.I.Gen
      VIPRE Artua Vladislav (fs)

      Delete
  2. can you give a demo about it ? thank you

    ReplyDelete
  3. Can you add a link to that library somewhere? I still can't find it. Then I can help you test on an HTC Evo.

    ReplyDelete
  4. I have posted the link to the code sample in the original post. If anyone fix this on Samgsung please let me know. Thanks

    ReplyDelete
  5. I'm getting an UnknownHostException while running this on my Samsung Galaxy S (Android 2.1).

    I can send MMS message fine using the built-in Messaging app. It retrieved APN connections settings fine (hostname,proxy,port,...) but fails when it tries to establish the HTTP connection.

    Had to make one change in the code to make it Android 2.1 compliant. There's no ConnectivityManager.TYPE_MOBILE_MMS in Android 2.1, so I replaced the constant with the integer type (2).

    ReplyDelete
  6. @Davy, Thanks for posting this.

    I tried to make this code work on Samsung Galaxy S as well. It didnt go very well, seems to me they have customize the standard mms.apk and using SMIL to send MMS. (You can also generate SMIL code using the sample code I have attached in my post, But you have to do small modification just look at the SetMessage function.)

    Anyway, One reason I could think of is proxy information you have passed could be invalid.

    use the below function to make sure you can connect to the proxy host or MMSC

    private void ensureRouteToHost(String proxyAddr) throws IOException {
    ConnectivityManager connMgr = (ConnectivityManager) getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);

    int inetAddr;
    inetAddr = lookupHost(proxyAddr);
    if (inetAddr == -1) {
    throw new IOException("Cannot establish route for " + url + ": Unknown host");
    } else {
    if (!connMgr.requestRouteToHost(ConnectivityManager.TYPE_MOBILE, inetAddr)) {
    throw new IOException("Cannot establish route to proxy " + inetAddr);
    }
    }
    }

    /**
    * Look up a host name and return the result as an int. Works if the argument
    * is an IP address in dot notation. Obviously, this can only be used for IPv4
    * addresses.
    * @param hostname the name of the host (or the IP address)
    * @return the IP address as an {@code int} in network byte order
    */
    public static int lookupHost(String hostname) {
    InetAddress inetAddress;
    try {
    inetAddress = InetAddress.getByName(hostname);
    } catch (UnknownHostException e) {
    return -1;
    }
    byte[] addrBytes;
    int addr;
    addrBytes = inetAddress.getAddress();
    addr = ((addrBytes[3] & 0xff) << 24)
    | ((addrBytes[2] & 0xff) << 16)
    | ((addrBytes[1] & 0xff) << 8)
    | (addrBytes[0] & 0xff);
    return addr;
    }

    ReplyDelete
    Replies
    1. I find the status as mention below and find this to be working few days back but now it is not working, anybody please help

      connected..
      GC_CONCURRENT freed 603K, 51% free 3029K/6087K, external 1888K/1888K, paused 4ms+3ms
      Message sent to http://100.1.201.171:10021/mmsc
      Response code: 200 OK
      CONTENT-ENCODING: gzip
      DATE: Tue, 09 Apr 2013 06:55:22 GMT
      CONTENT-TYPE: application/vnd.wap.mms-message
      CONNECTION: close
      CONTENT-LENGTH: 68
      SERVER: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.7a
      04-09 12:26:01.890: V/SendMMSActivity(17277): endMmsConnectivity

      Delete
  7. Thanks for posting the link to the Nokia Java based MMS impelmentation, but what happened to the code you had posted here, with a method called sendMMSUsingNokiaAPI()?

    ReplyDelete
  8. @Tyler, What i did was, I copied all the Nokia based MMS implementation java classes into Android project so it can help me to create the MMS message. In any platform MMS message format is a standard, so it's doesn't matter as long as MMS Message format is a standard.

    ReplyDelete
  9. i downloaded the code and when i run the code i just get blank screen with the "Hello world, sendMMSACtivity" on my emulator can anybody help me understand how to run it

    ReplyDelete
  10. You cannot test MMS On emulator, Sorry

    ReplyDelete
  11. When I run this code in my HTC device , I just get blank screen with hello world text , when I debug this code, I observe that I am getting blank values for MMS Proxy and MMS Port.., then I checked these values from mobile network Settings from the Settings screen of the device, actually nothing was set there.. but built in MMS is working normally..
    please suggest me, if I need to manually set the values for Proxy and Port before run this code.. If it is suggest me which values I need to set. I am using T-Mobile carrier.

    ReplyDelete
  12. @zameer,
    1. Check whether you get MMSC value in the code. If you have mmsc you do not need MMS Proxy and Port to send MMS.

    2. In BroadcastReceiver Make sure make sure you can connect to the mms access point.

    check for.
    if (!mNetworkInfo.isConnected()) {

    ReplyDelete
  13. hi..is this application invokes the built in app from the phone?i have no device to test the application.

    ReplyDelete
  14. Not able to send MMS from milestone using the code, application hangs can any one help on the issue.

    ReplyDelete
  15. @Gautam Did you try debugging the code to identify the line ?

    One thing I can think of is to make sure Proxy host or MMSC

    ReplyDelete
  16. i am getting exception Host is unresolved: mms1.hutchworld.co.in:80 while opening the connection in send method connection.getOutputStream();

    ReplyDelete
  17. I am Unable to send mms through this code u given in ziddu site.


    log file is like
    >>BroadcastReceiver onReceive

    and if exit the app it is like

    >>Activity com.androidbridge.SendMMS3.SendMMSActivity
    >>has leaked IntentReceiver >>com.androidbridge.SendMMS3.SendMMSActivity$Connectivi>>tyBroadcastReceiver@406a3cf8 that was originally >>registered here. Are you missing a call to
    >>unregisterReceiver()?

    ReplyDelete
  18. Basically am getting APN TYPE =""

    thats why it is returning empty list...
    can you help me out in this

    ReplyDelete
  19. @Ankit.

    You need to configure APN settings before sending a MMS. Can you send a MMS using the phone application with the current settings ?

    APN normally has MMSC address. MMSC is the base point to post the MMS message.

    ReplyDelete
  20. I am able to do it by Phone SMS application with current setting..
    and it is working fine...

    ReplyDelete
  21. This comment has been removed by the author.

    ReplyDelete
  22. @ Aruna
    getting this \/ exception
    java.net.SocketException: Connection reset by peer

    in this line of code

    responseCode = connection.getResponseCode();

    ReplyDelete
  23. Hi!
    I'm also stuck on the response part of the code, but I just get no activity until the socket times out.
    Any ideas why the server is not answering?

    ReplyDelete
  24. @Risto,

    One reason I could think of is proxy information you have passed could be invalid.

    call ensureRouteToHost function i have mentioned in my previous post.

    ReplyDelete
    Replies
    1. i had the same thing. socket times out

      i can use the own app message send a mms.

      i used function ensureRouteToHost ----
      03-29 13:51:54.877: W/System.err(2174): java.io.IOException: Cannot establish route to proxy -1409286134

      final String MMSProxy = results.get(0).MMSProxy; ensureRouteToHost(MMSProxy);

      is this the right?

      03-29 13:53:18.317: W/System.err(2174): java.net.UnknownHostException: Host is unresolved: mmsc.monternet.com:80

      ????????help me????????????

      Delete
  25. It is working for me, but I am trying to start AsycnTask from broadcast receiver and run sendMMSUsingNokiaAPI(), but it freezes on send().
    Same happens if I try to run all code in service running in separate process.

    ReplyDelete
  26. @V3nom and Aruna Tennakoon

    Do we need to do any changes in this application(Downloaded from Ziddu)

    as it is not working for me. or anything u wanna share...
    It is just giviing socket or unknown host exception in getResponseCode method...

    Help me out in this...?

    ReplyDelete
  27. I have the problem that Gautam Bisht has.

    I have "Host is unresolver: mmsc: 80" in connection.getOutputStream()

    Otherwise my APN is 8080.

    ReplyDelete
  28. @Maxim.

    obviously this error means the URL can't be resolved via DNS.

    1. did you try the ensureRouteToHost function i have posted above?

    2. If you are behind a proxy you should configure it.

    ReplyDelete
  29. I ran this code on HTC Desire and i am keep getting a Internal server error message in the 'MMResponse send' method in the MMSender.Java.

    Any help would be appreciated. I can send MMS normally.

    Thanks,

    ReplyDelete
  30. Really need some help. For some reason I am getting a fileNotFoundException: http://pxt.vodafone.net.nz/pxtsend.

    Getting the error in the following line
    DataInputStream i = new DataInputStream(connection.getInputStream());

    This is in the MMSender.java file.

    Please can some one help me with this.

    ReplyDelete
  31. I would like to backup and restore MMS programmatically. How do i achieve it ? Please help me.

    ReplyDelete
  32. Can , check here
    http://stackoverflow.com/questions/3012287/how-to-read-mms-data-in-android

    ReplyDelete
  33. The posted URL isn't valid anymore. It says the file http://www.filesonic.es/file/1506650654/SendMMS3.zip has been deleted.
    Anybody has any update on this?


    Thanks,
    T.

    ReplyDelete
  34. Oh, Looks like they have deleted it. You can get it from here

    http://www.ziddu.com/download/14286605/SendMMS3.zip.html

    ReplyDelete
  35. So:
    - JMMSLib doesn't always work
    - NOkia´s bridge mostly works, except on Samsung?

    I know we are in undocumented territory, but have you found any Java implementation that works on all Android devices (besides simply calling the default device software wia Intent with ACTION_SEND and EXTRA_STREAM)?

    Debugging the default MMS send/recv on my Samsung Galaxy, I can see that it is using SMIL ('application/smil'). I'm looking in that direction right now.

    Thanks again,
    T.

    ReplyDelete
  36. Hello,
    I am using the SendMMS3 code and am stuck here:
    "List getMMSApns" method gets a apnCursor but ultimately returns empty list. I am working on Motorola Droid with Android version 2.2.2. I am able to send MMS through device fine.
    Do I need to manually set the APN? OR the apnCursor should be able to pragmatically extract it out?

    ReplyDelete
  37. @Anand,

    "List getMMSApns" should return all the APNs thats created here,

    Settings -> Mobile Networks -> Access Point Names.

    1. Go and check whether you have access points defined here.

    2. Check whether there is one for MMS.

    3. if yes, hard code the APN settings in the code and try.

    ReplyDelete
  38. Hello,
    The code works for me now when certain contitions have been met. One has something to do with my service provider and I can talk about it with them, but the other is that
    when mobile data is enabled then startUsingNetworkFeature "enableMMS" returns "not available". When I turn off mobile data then it works. What should I change to get it working with mobile data enabled ?

    ReplyDelete
  39. Hi hello

    I want to send a mms automatically,i am using the following code ,but its asking user to press a button

    Intent intent = new Intent(Intent.ACTION_SENDTO);
    intent.putExtra("address", "12134567899");
    intent.putExtra("sms_body", "See attached picture");

    //intent.putExtra(Intent.EXTRA_STREAM,
    //Uri.parse("content://media/external/images/thumbnails/0"));
    intent.putExtra(Intent.EXTRA_STREAM,
    Uri.parse("file:///sdcard/DCIM/Camera/2011-09-09 12.47.29.jpg"));
    intent.setType("image/png");

    // This is added just so the AndroidTestCase launches the activity as expected, remove this line in your production code
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    //intent.se
    startActivity(intent);

    ReplyDelete
  40. You can not send SMS automatically using Intents. They always show the pop-up.

    ReplyDelete
  41. Hi hello

    I want to send a mms automatically,i am using the following code ,but its asking user to press a button

    Intent intent = new Intent(Intent.ACTION_SENDTO);
    intent.putExtra("address", "12134567899");
    intent.putExtra("sms_body", "See attached picture");

    //intent.putExtra(Intent.EXTRA_STREAM,
    //Uri.parse("content://media/external/images/thumbnails/0"));
    intent.putExtra(Intent.EXTRA_STREAM,
    Uri.parse("file:///sdcard/DCIM/Camera/2011-09-09 12.47.29.jpg"));
    intent.setType("image/png");

    // This is added just so the AndroidTestCase launches the activity as expected, remove this line in your production code
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    //intent.se
    startActivity(intent);

    ReplyDelete
  42. @prateek, You can not send MMS in Android using Intent. If you want to send MMS automatically then you need to try the sample code I have attached in the post.

    ReplyDelete
  43. @Risto, Strange case. Do you have wifi enabled when you try to send the MMS? normally there is no way send MMS without connecting to the service provider APN.

    Also try the code posted here to force the network rote

    http://stackoverflow.com/questions/2513713/how-to-use-3g-connection-in-android-application-instead-of-wi-fi

    ReplyDelete
  44. Hi
    Aruna
    i wanted to know that is it possible to send the MMS without using the predefined intent i e through user defined intent

    ReplyDelete
  45. I am not using WiFi connection,i am using internet in my cell phone.Is there any way that we can send the MMS using user defined Intent

    ReplyDelete
  46. The code was working for me on HTC sensation 3 weeks ago, but the same apps doesn't work on HTC Desire now.(My HTC Desire can send MMS by default SMS sender) I get the HTTP response code 400(Bad Request), anyone can help me? Thanks.

    ReplyDelete
  47. The code could not work for Android 2.2, I updated HTC Desire to 2.3.3 and send MMS OK.

    ReplyDelete
  48. @terry, Glad it worked out for you. When I was testing I used to get HTTP response code 400 too I am quite not sure why is that as well.

    ReplyDelete
  49. This comment has been removed by the author.

    ReplyDelete
  50. This comment has been removed by the author.

    ReplyDelete
  51. hai aruna.firstly thanks for the code.It is working fine in lg optmus one (2.2) and airtel network.But if i use airtel network and run on nexusone(2.3) its giving me connection timed out.similarly if i use vodafone it fails in both cases giving me filenotfound exception..how to crack this.. iam really confused...

    ReplyDelete
    Replies
    1. You are welcome.

      I had the same issue (FileNotFoundException) when I was testing this app. I could n't quite figure out whats wrong as well. I think it will be helpful if you go through the Android source code and figure out what's the reason to trow this error. If you find out please post it here.

      Delete
  52. Hello, I downloaded the .zip file and imported it in eclipse but actually i didn't know which package should I use and how shall i integrate this code with my project ?
    I tried this code with my Galaxy tab 7.9 but it shows: Hello world with blank page !

    Can anyone advice me ?
    -----
    Note: my android application should Send and Receive MMS,

    ReplyDelete
    Replies
    1. Check the source-code.

      Put a break point onCreate there and start debugging the code.

      Delete
  53. Replies
    1. Where are you located? When I follow the Zuddu link it simply states "Sorry! Ziddu is not offering any file sharing services !!" I am in the US, perhaps they are no longer allowing US ip's to download as a result of megaupload aftermath =x

      Delete
    2. Post your email id here. I will send it to you via email

      Delete
    3. foamyguy@gmail.com

      Thank you kindly. I very much appreciate.

      Delete
  54. please..help me...i'm new at developing android, and i don't understand how to compile this project...all i got just "Send MMS Activity" words...

    ReplyDelete
  55. Hi,

    i would really like to use this code. I manage to initiate sending and it does send something, somewhere...I typed a receiver phone number into the mm.addToAddress, however the MMS does not come to that address. I was checking the NOKIA documentation to figure out what is transaction and what the format of the number should be...and right now I am a bit lost. Can anybody help me with that. Thanks

    ReplyDelete
  56. Hi, i learning android. I try to send mms in loop to the different number. And i have a question how to cheange the code properly. I tried use loop in ConnectivityBroadcastReceiver and other way ConnectivityBroadcastReceiver in loop. But i get the error "intent leaked, ... missing unregister receiver"

    ReplyDelete
  57. Thank you for the amazing post here. I was able to send an MMS to myself after some tweaking yet I want to attach a file to the content of the MMS... MP3? OGG? XML? I can't attach anything...Any time I do the file is not recieved on the other end I don't understand why?

    ReplyDelete
  58. Hi Aruna,
    Thanks for sharing useful information and helping everyone out on this topic.

    I am also not able to download code from ziddu link what you had referred. Could you please send me the code at my email id: hsdev1@yahoo.com

    Thanks,
    ~Hari

    ReplyDelete
  59. I have used ur code , It worked fine for initial 2-3 trials but thn it stopped working on any of my android devices. now i am getting response code "303" in http response & 'See Other' as response message

    ReplyDelete
  60. It's not working for me. In MMSender.java, send function, the connection response code is "ERROR 403: Invalid MSISDN number received". The MSISDN number is the recipient phone number, and it is definitely not invalid.

    If anyone is interested, I'd be willing to pay $200 paypal to anyone who can get a code sample working on my galaxy s2. Contact me at sbheinric attt gmail dotcom if interested.

    ReplyDelete
  61. Hey , sorry to trouble you but can you please help me test this application for sending MMS in Samsung Galaxy S2?

    ReplyDelete
  62. Hello, I have one question...Do you know how prevent an image form changing size when sending? Or it's impossible to do it?

    ReplyDelete
  63. For anyone getting a response code 400 from the MMSC, try removing the "if (isProxySet) {...}" from MMSender.java, and instead:

    Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, proxyPort));
    ...
    connection = (HttpURLConnection) url.openConnection(proxy);

    I needed this for a pantech crossover with android 2.2.1

    ReplyDelete
  64. I am able to send MMS but sending 3 times success of only 1 time ration make me unhappy and in the code I found that MMS subject field is mention but where is the Message feild.

    ReplyDelete
  65. how to send message body, i found only subject can be send..

    ReplyDelete
  66. This comment has been removed by the author.

    ReplyDelete
  67. Hello, I'm using Samsung Galaxy Ace, and I don't know, why the application don't work. Its show to me on LogCat TimeEnd.

    ReplyDelete
  68. Bess I'm also using samsung galaxy ace.. it work fine for me..

    ReplyDelete
  69. kamal, please, you don't make any changement!!!

    ReplyDelete
    Replies
    1. Basically I change for access of different APN type and the application architecture, acc. to my need.. and this shouldn't make any difference.

      Delete
    2. This comment has been removed by the author.

      Delete
    3. I used the same code on Galaxy Ace (Android version 4.0.4) and Galaxy Pocket(Android version 2.3.6). On Galaxy Pocket, it work fine. But on Galaxy Ace, it show to me on Log info: threadid=3: reacting to signal 3
      Wrote stack traces to '/data/anr/traces.txt'

      Delete
  70. Can I get the Delivery Report?

    ReplyDelete
  71. I find the status as mention below and find this to be working few days back but now it is not working, anybody please help

    connected..
    GC_CONCURRENT freed 603K, 51% free 3029K/6087K, external 1888K/1888K, paused 4ms+3ms
    Message sent to http://100.1.201.171:10021/mmsc
    Response code: 200 OK
    CONTENT-ENCODING: gzip
    DATE: Tue, 09 Apr 2013 06:55:22 GMT
    CONTENT-TYPE: application/vnd.wap.mms-message
    CONNECTION: close
    CONTENT-LENGTH: 68
    SERVER: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.7a
    04-09 12:26:01.890: V/SendMMSActivity(17277): endMmsConnectivity

    ReplyDelete
  72. hi @ Aruna Tennakoon, i checked this with nexus s ics in Mobitel network.
    no errors and just showing the "hello world, sendmmsactivity!" message. mms settings also fine. can send mms using phone. but when i used the this app no errors but mms won't send to the destination. Please help me reguarding this.

    ReplyDelete
  73. it is nice blog. A business plan is what is going to happen in your smoothie business and how you are going to manage it. Installerex

    ReplyDelete
  74. it great and nice post. Because of the way the links are implemented, the application will also create links out of telephone numbers that take you to the dialer and URLs that start up the browser. installerex custom installers

    ReplyDelete
  75. This game is a soccer game is quite popular in his circle. And on this occasion I will try to share about this game PES 2011 for your favorite Android phone. installerex custom installers

    ReplyDelete
  76. [10:17:20 AM] Hoang Tu: 07-28 10:09:26.746: I/System.out(7345): failed to connect to /192.168.233.10 (port 8080): connect failed: ETIMEDOUT (Connection timed out)
    07-28 10:09:26.746: W/System.err(7345): java.net.ConnectException: failed to connect to /192.168.233.10 (port 8080): connect failed: ETIMEDOUT (Connection timed out)
    07-28 10:09:26.846: W/System.err(7345): at libcore.io.IoBridge.connect(IoBridge.java:114)
    07-28 10:09:26.846: W/System.err(7345): at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192)
    07-28 10:09:26.846: W/System.err(7345): at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459)
    07-28 10:09:26.846: W/System.err(7345): at java.net.Socket.connect(Socket.java:848)
    07-28 10:09:26.846: W/System.err(7345): at libcore.net.http.HttpConnection.(HttpConnection.java:77)
    07-28 10:09:26.846: W/System.err(7345): at libcore.net.http.HttpConnection.(HttpConnection.java:50)
    07-28 10:09:26.846: W/System.err(7345): at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:351)
    07-28 10:09:26.856: W/System.err(7345): at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:86)
    07-28 10:09:26.856: W/System.err(7345): at libcore.net.http.HttpConnection.connect(HttpConnection.java:99)
    07-28 10:09:26.866: W/System.err(7345): at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:308)
    07-28 10:09:26.866: W/System.err(7345): at libcore.net.http.HttpEngine.connect(HttpEngine.java:303)
    07-28 10:09:26.866: W/System.err(7345): at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:282)
    07-28 10:09:26.866: W/System.err(7345): at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:232)
    07-28 10:09:26.866: W/System.err(7345): at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:80)
    07-28 10:09:26.916: W/System.err(7345): at libcore.net.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:188)
    07-28 10:09:26.916: W/System.err(7345): at com.ambient.audiophoto.mms.lib.MMSender.send(MMSender.java:176)
    07-28 10:09:26.946: W/System.err(7345): at com.ambient.audiophoto.mms.lib.MMSender.send(MMSender.java:95)
    07-28 10:09:26.986: W/System.err(7345): at com.ambient.audiophoto.mms.MmsSender.sendMMSUsingNokiaAPI(MmsSender.java:236)
    07-28 10:09:27.026: W/System.err(7345): at com.ambient.audiophoto.mms.MmsSender.access$12(MmsSender.java:208)
    07-28 10:09:27.096: W/System.err(7345): at com.ambient.audiophoto.mms.MmsSender$MmsAsync.doInBackground(MmsSender.java:525)
    07-28 10:09:27.106: W/System.err(7345): at com.ambient.audiophoto.mms.MmsSender$MmsAsync.doInBackground(MmsSender.java:1)
    07-28 10:09:27.106: W/System.err(7345): at android.os.AsyncTask$2.call(AsyncTask.java:264)
    07-28 10:09:27.106: W/System.err(7345): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
    07-28 10:09:27.106: W/System.err(7345): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
    07-28 10:09:27.106: W/System.err(7345): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208)
    07-28 10:09:27.106: W/System.err(7345): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
    07-28 10:09:27.106: W/System.err(7345): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
    07-28 10:09:27.106: W/System.err(7345): at java.lang.Thread.run(Thread.java:856)
    07-28 10:09:27.116: W/System.err(7345): Caused by: libcore.io.ErrnoException: connect failed: ETIMEDOUT (Connection timed out)
    07-28 10:09:27.126: W/System.err(7345): at libcore.io.Posix.connect(Native Method)
    07-28 10:09:27.126: W/System.err(7345): at libcore.io.BlockGuardOs.connect(BlockGuardOs.java:85)
    07-28 10:09:27.126: W/System.err(7345): at libcore.io.IoBridge.connectErrno(IoBridge.java:127)
    07-28 10:09:27.126: W/System.err(7345): at libcore.io.IoBridge.connect(IoBridge.java:112)
    07-28 10:09:27.137: W/System.err(7345): ... 27 more
    07-28 10:09:27.137: D/MmsSender(7345): unfinish

    ReplyDelete
    Replies
    1. As you can see it can not connect to the IP and the port. Make sure you are connected to MOBILE internet not WIFI

      Delete
  77. I had problem when use LG LU6200
    TIMEOUT issues
    Please take a look at above log
    Help me please

    ReplyDelete
  78. can anybody help to resolve connection timeout problem please..

    ReplyDelete
  79. the same code is running in USA but not in India....

    ReplyDelete
  80. i need automatically sending mms code for android without intent

    ReplyDelete
  81. I'm set apn value this :
    apn.MMSCenterUrl = "http://mms.trueh.com:8002/";
    apn.MMSProxy = "10.4.7.39";
    apn.MMSPort = "8080";
    apn.MMSUser = "true";
    apn.MMSPassword = "true";

    Then show error below :
    com.androidbridge.nokia.MMSenderException: failed to connect to mms.trueh.com/174.36.107.130 (port 8002): connect failed: ETIMEDOUT (Connection timed out)

    Help me please
    Thank for advance

    ReplyDelete
  82. Hello,

    I have following question for mms,Can you please helo me,
    How to create the m-notification-ind for receive the mms?
    OR
    How to parse the receive mms pdu?
    OR
    How t create the m-notification-ind pdu from url?

    Thanks

    ReplyDelete