Why Android application does not connect to the sever on a real device?

There server has a client on Android. Connection using sockets in a local network Wi-Fi. On the emulator the app connects to the server, and the real device. What could be the problem?

W/System.err: java.net.ConnectException: failed to connect to /192.168.56.1 (port 8383) from /:: (port 47742): connect failed: ECONNREFUSED (Connection refused)
at libcore.io.IoBridge.connect(IoBridge.java:137)
March 19th 20 at 08:53
2 answers
March 19th 20 at 08:55
Connection refused. The port is open in firewall server?
Yes. On the emulator, Android and PC clients it works. On physical Android-e gives it - madelyn_Hirthe commented on March 19th 20 at 08:58
@madelyn_Hirthe, and whether you need permission... can they matter? - elise_Raynor10 commented on March 19th 20 at 09:01
Damn and I have the same shit with the connection to the FTP server from the emulator everything is OK, and with glands - the same error. On another of my mobile phone (and even Android 9) in the same WiFi network - everything works OK. - Daniella.Cormi commented on March 19th 20 at 09:04
@elise_Raynor10,
<uses-permission android:name="android.permission.INTERNET"/>
 <uses-feature android:name="android.hardware.wifi"/>
 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
 <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>


I don't know, to wonder, MB what else is needed? - madelyn_Hirthe commented on March 19th 20 at 09:07
@Daniella.Cormi, uh, even from smart depends. Weird. In the vast anglonet something I have not yet found a solution, all the tips boil down to the server side, but I'm sure so - madelyn_Hirthe commented on March 19th 20 at 09:10
@madelyn_Hirthe, like, that's enough - elise_Raynor10 commented on March 19th 20 at 09:13
@elise_Raynor10, so it seems to me. Just the hopelessness of some sort. And okay, if you libs for konekta to use, but no - need sockets and its implementation - madelyn_Hirthe commented on March 19th 20 at 09:16
@Daniella.Cormi, I solved the problem for themselves. Can watch, perhaps you, too, in this case. - madelyn_Hirthe commented on March 19th 20 at 09:19
@madelyn_Hirthe, don't exactly decided what I did. - Daniella.Cormi commented on March 19th 20 at 09:22
@Daniella.Cormi, my "server" is in fact the app on the PC that connects to the device in the local network. Should have clarified, maybe it greatly changes the picture and this is another case for you. In my situation, the phone had to connect over ip to the wireless adapter. But even this did not work until the phone is hiding verlome working VPN - madelyn_Hirthe commented on March 19th 20 at 09:25
@madelyn_Hirthe, how is it treacherous ? And that nailed it and worked ? - Daniella.Cormi commented on March 19th 20 at 09:28
@Daniella.Cormi, I was apps for VPN and to use telegram when needed, and my firmware (MIUI) has started to default to using, and this confirms the consumption of the battery 50 percent in radio. Yes, uninstalled and worked - madelyn_Hirthe commented on March 19th 20 at 09:31
March 19th 20 at 08:57
The problem is solved. They were just two: my phone's default without my knowledge used the VPN server (and I think why the 50 cent charge on the network goes Lule). The second connection to the Ethernet adapter VirtualBox Host-Only Network, knowingly decided in ipconfig to get. I, of course, needed a wireless network adapter.
5c9bbcff25278845741318.png

Find more questions by tags AndroidJava