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

3
  • do you need something like stackoverflow.com/questions/4994759/… ? Commented Feb 5, 2014 at 22:31
  • Thanks but thats for xampp I'm trying to have two android devices talk to each other Commented Feb 5, 2014 at 22:36
  • not xAmpp but SMACK lib on XMPP which is intended to make a chat and even chatrooms between devices. Commented Feb 5, 2014 at 22:39

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

THANK YOU! I just figured it out and went back here to post the answer but you beat me! :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.