1

I have two apps a TCP server and a client app. I have to use redir add tcp:5000:6000 to get the client to talk to the server. but if I try to load the apps on two actual devices the client fails because it can't connect.

How can I get the two apps on the two different devices to talk to each other like the simulator? This is what I'm using for TCP TCP EXAMPLE APP

Squonk
  • 48,735
  • 19
  • 103
  • 135
Never_Nude
  • 27
  • 5
  • do you need something like http://stackoverflow.com/questions/4994759/how-to-receive-incoming-messages-using-smack-lib-on-xmpp ? – Stan Feb 05 '14 at 22:31
  • Thanks but thats for xampp I'm trying to have two android devices talk to each other – Never_Nude Feb 05 '14 at 22:36
  • not xAmpp but SMACK lib on XMPP which is intended to make a chat and even chatrooms between devices. – Stan Feb 05 '14 at 22:39

1 Answers1

1

In the Client.java file change the following two lines...

private static final int SERVERPORT = 5000;
private static final String SERVER_IP = "10.0.2.2";

SERVERPORT needs to be the same number as that in the Server.java file, i.e., 6000.

SERVER_IP needs to be the actual IP address of the Android device running the server app.

Squonk
  • 48,735
  • 19
  • 103
  • 135