Finally I solved it. I stopped sucking with Emulator. I got 2 Android device. I added the next code to the Server:
public static String getIPAddress() {
try {
List<NetworkInterface> interfaces = Collections.list(
NetworkInterface.getNetworkInterfaces());
for (NetworkInterface networkInterface : interfaces) {
List<InetAddress> addresses = Collections.list(
networkInterface.getInetAddresses());
for (InetAddress inetAddress : addresses) {
if (!inetAddress.isLoopbackAddress()) {
String sAddress = inetAddress.getHostAddress().toUpperCase();
if (InetAddressUtils.isIPv4Address(sAddress)) {
return sAddress;
} else {
int delim = sAddress.indexOf('%');
return delim < 0 ? sAddress : sAddress.substring(0,
delim);
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
return "";
}
Now I can get the Server address what looks like: 192.168.1.X. I put it to a TextView on the Server device and the Clients have to enter this ip to connect to the Server. It is enough for me, because I want to use it on the local network.