问题
I want two connect two emulators and i wish to establish SOCKET connection between them. Problem i am facing is I have to use two different ip address for client and socket. Android emulator have static ip 10.0.2.15. Is it possible to change the ip address? If not then how can i establish Socket connection between 2 emulators.
The program i have is working fine with two devices,but how to do it for two emulators
回答1:
Take a look at this thread, this thread, and the docs on port forwarding. Also take a look at this thread in Google Groups.
回答2:
Here's a coded example from a while back Connecting 2 Emulator instances In Android
.
来源:https://stackoverflow.com/questions/6322533/connecting-two-emulators-to-establish-socket-connection-between-them