views:

110

answers:

1

I have been trying to setup a Droid to Droid 3G connection. I can confirm that all works great in wifi mode. The Droid can make connection requests (Http, Telnet, raw sockets) in 3G, but I cannot get the Droid to accept a socket connection in 3G mode. I am using the java.net.ServerSocket class.

If anyone knows how to program the Droid to accept socket connection requests over 3G, please respond. Also, if anyone knows why this is not allowed please respond.

Thanks for having a look,

Burgwindeck

+1  A: 

Odds are, you do not have a public IP address, as most mobile carriers use NAT or the equivalent. Hence, there is no way for anyone to communicate with you, regardless of whether or not you have a socket open.

Also, bear in mind that having a socket open on a phone is a security risk, no different than having active ports on desktops or servers.

You might consider using some form of long-poll (Comet) or other form of device-initiated connection. You might also need to use some sort of public server as a proxy -- public connects to the server, device connects to the server, server exchanges packets between sides.

CommonsWare