You say no other connections are available so I don't know who useful this answer would be, but I was able to do this through WiFi and a cheap router. The address of the PC socket is the IP address of the wireless PC port, found through ipconfig. I have a further posting pending about difficulty in keep the connection up for the long term, but that's a different issue. To connect the phone to the router go to Settings->Wifi.
On Dec 10, 3:50 am, feng jacky <jacky...@gmail.com> wrote: > Hi, > > I wrote a TCP socket client, an android application. On my emulator, it can > successfully connect to a TCP sever running in my PC. But, when I deployed > the the apk into my real phone, HTC g4, it dosen't work. An exception was > raised said "java.net.SocketException: Network unreachable". > > The situation is, my handset was connected to my PC via USB, and no other > connections were available. How can my android application connect to a PC > server in the case. I don't know if we can use socket over usb connection. > If yes, then why my application doesn't work. If no, then how? > > Thanks a lot. > > jack -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en