Android Socket: java.net.SocketException: no host path

I am trying to connect (via TCP) to a server running on my computer from an Android device. I have android.permission.INTERNETin my manifest file:

<uses-permission android:name="android.permission.INTERNET"></uses-permission>

I can connect using the emulator, but trying from the device causes an error:
Android Socket: java.net.SocketException: No route to host

Someone can help.

+5
source share
3 answers

Turned off Wi-Fi on my Android device, and then turned it back on and it worked.

+13
source

The address 192.168.1.114 is the DHCP address (dynamically) assigned by your router to your computer. As a result, it is displayed in the emulator.

, Wi-Fi, Android, , / 192.168.1.114. , 192.168.1.114 Android.

192.168.1.114 Android, , , DNS- .

+5

. , Win7 .

0

All Articles