sockets - Android using TCP between 2 simulators -


i have 2 apps tcp server , client app. have use redir add tcp:5000:6000 client talk server. if try load apps on 2 actual devices client fails because can't connect.

how can 2 apps on 2 different devices talk each other simulator? i'm using tcp tcp example app

in client.java file change following 2 lines...

private static final int serverport = 5000; private static final string server_ip = "10.0.2.2"; 

serverport needs same number in server.java file, i.e., 6000.

server_ip needs actual ip address of android device running server app.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -