0

I'm looking at the code posted here for sending MMS through an Android Application, and I'm very close. I have successfully sent an MMS while the Wifi connection is NOT enabled. But when it comes time to use the httpConnection in never connections when Wifi is enabled. I've read several posts saying to use

ConnectivityManager.requestRouteToHost(ConnectivityManager.TYPE_MOBILE_MMS,APNBACKENDIP);

And that function returns true meaning that it should route traffic over the TYPE_MOBILE_MMS interface, but it always times out. Can anyone point me in the right direction? Also I tried using TYPE_MOBILE instead of TYPE_MOBILE_MMS and the function returns false instead.

Community
  • 1
  • 1
apmeyers1987
  • 859
  • 1
  • 7
  • 11

1 Answers1

1

Turns out it was an incredibly simple answer....I had my IP quad reversed when calculating the IP address for requestRouteToHost.

I.E I had:

int address = ((addr[0] & 0xFF) << 24) | ((addr[1] & 0xFF) << 16) | ((addr[2] & 0xFF) << 8) | (addr[3] & 0xFF);

Whereas it should be:

int address = ((addr[3] & 0xFF) << 24) | ((addr[2] & 0xFF) << 16) | ((addr[1] & 0xFF) << 8) | (addr[0] & 0xFF);
apmeyers1987
  • 859
  • 1
  • 7
  • 11
  • 1
    Could you provide your code for sending MMS. It will be appreciated if you do that. I tried to search all over the internet and read the docs and came out with nothing :( – iTurki Jul 23 '11 at 06:35
  • Hey @apmeyers1987, i looked into the examples you gave of sending MMS, but I am having some issues: http://stackoverflow.com/questions/14452808/sending-and-receiving-sms-mms-in-android . How did you get this to work? – Etienne Lawlor Mar 09 '13 at 21:12