I have an Android application running on a phone connected to the host machine via USB. The phone will always be connected to the device, and I need to send an HTTP request to the device. While working in the emulator, I can access the web server running on the computer using the IP address 10.0.2.2, and this works fine. However, by running the same application on the phone, I get a SocketException from Network unreachable . The phone does not have a SIM card in it and does not have Wi-Fi connection, I need an HTTP request to just transfer the USB to the computer. Is it even possible? If so, what am I doing wrong.
I use the standard HttpClient code, nothing special that works absolutely fine if I run it on the phone using a Wi-Fi connection, so I know this is not a problem.
jackbot
source share