Connecting two emulators to establish Socket connection between them

十年热恋 提交于 2019-12-11 04:28:17

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!