The title is the question....
-
@Kevin - how does this differ from your earlier question of similar title? – martin clayton Jan 14 '10 at 14:39
-
@Martin: I actually didn't remember that I had already asked this question earlier, thanks for reminding.. – Kevin Boyd Jan 14 '10 at 20:18
-
Kevin's previous question is http://stackoverflow.com/questions/2023223/javame-implementing-peer-to-peer-communication :) – martin clayton Jan 14 '10 at 20:41
-
@Martin: Thanks for the link, maybe admin can link up these posts for a consolidated set of answers. – Kevin Boyd Jan 14 '10 at 21:02
2 Answers
Due to restrictions imposed by Network Operators, it will be impossible to have mobile phones talk directly to each other. So, you will need to implement an HTTP service that will act as the middle man.
The idea is that mobile phones will connect to the service and register. They will then use the service to discover other connecting phones. The service will finally proxy the conversation between two connected devices. A suitable software layer could make the whole process transparent.

- 103,016
- 27
- 158
- 194
-
1There are J2ME applications that supports peer to peer gaming without using additional servers. – Szere Dyeri Jan 14 '10 at 06:16
-
This is possible only with a Wi-Fi connection, not with 3G or GPRS. – kgiannakakis Jan 14 '10 at 08:04
You can open a ServerSocketConnection and a SocketConnection on the other side. This allow two way direct communication between two mobile phones. You can look at this page for some more details.
Possibly you can send the initial connection information by SMS and after that switch to socket communication.

- 14,916
- 11
- 39
- 42
-
Actually I am looking for a solution for multiple phones, and I'm not worried about the cellular network because the phones are connected through WLAN. – Kevin Boyd Jan 14 '10 at 06:26
-
Then you need a find a way to find peers. It is difficult with multiple phones and no central server. Perhaps you really need a central server. – Szere Dyeri Jan 14 '10 at 06:34
-
What if I aleardy know the IP and MAC of the peers is it possible then? – Kevin Boyd Jan 14 '10 at 06:46
-
1Yes it is possible. You just need the IP addresses. You also need port number but you can fix it anyway. Depending on what you want you can one one phone act as a server and others connect to it or have multiple servers. Most phones will have security restrictions on using sockets. But you can always sign your application to overcome that. – Szere Dyeri Jan 14 '10 at 06:54