5

I want to send an image via MMS programmatically in Android. I am following the links below:

http://androidbridge.blogspot.com/2011/03/how-to-send-mms-programmatically-in.html

How to send image via MMS in Android?

It works sometimes but mostly I get a "java.net.SocketException: The operation timed out".

Can any one provide more information regarding this problem?

Community
  • 1
  • 1
Sando
  • 1,893
  • 11
  • 29
  • 45

2 Answers2

0

MMS is just a htttp-post request send using extra network

you can download the source code here.
http://www.ziddu.com/download/14286605/SendMMS3.zip.html

I checked.Its work.
patel
  • 830
  • 1
  • 11
  • 26
  • I am doing something similar HERE!!! http://stackoverflow.com/questions/14452808/sending-and-receiving-mms-in-android – Etienne Lawlor Jan 22 '13 at 06:41
  • @patel I get connection time out at "out = connection.getOutputStream()" in mmsender.java – Jaldip Katre Dec 10 '13 at 05:55
  • I'm having a lot of trouble with sending MMS. I would really appreciate it if you could help me! https://stackoverflow.com/questions/47448316/cannot-send-mms – Ruchir Baronia Nov 23 '17 at 05:45
0

Sounds like you are really having a timeout. You say it sometimes works... Do you have a reception problem with your 3G (or whatever you are using) data network in your area?

If you are surfing the internet from the same location and pages don't load refresh and timeout, then that's probably your problem.

Try where you know the reception is good. You can bypass this problem by catching the exception and retry the sending of the message a few more times before popping a message to the user that the message could not be sent or the such. Better yet would be to save a history of unsent messages so that the user can resend them later. Of course I am assuming that the sending of the message is user driven. If not, you could check the data reception from time to time (every few minutes) and then resend when good enough until it goes through.

Hope that I helped.

sprite
  • 3,724
  • 3
  • 28
  • 30