narok119 wrote:
I've tried to find the best way to connect between Android and Windows
PC.
I think that the best way is use java.net.*(Socket and ServerSocket)
but i am not sure about the IP of Emulator and my Windows (Emulator is
running on Windows).
Sockets work quite well when initiating from Android to PC. To
date I've been unable to have a PC connect to a Server running on
Android.
But i have a question
Is the Emulator's IP same as my Windows's IP?
No
if the answer is YES , how can two same IP devices communcate
together?
if the answer is NO , how can i findout my Emulator's IP becuase I've
tried to run "ifconfig" to look for emulator's IP but nothing happend.
The ifconfig in Android has limited capability. You can get a better
ifconfig via busybox and then you see that the address is 10.0.2.15.
Another words its on it's own subnet and qemu/emulator uses
the PC as a gateway at 10.0.2.2.
A version of busybox for Android can be gotten at:
http://benno.id.au/blog/2007/11/14/android-busybox