从Android模拟器//本地主机Web服务器在Eclipse:如何连接到我的HTTP我的、模拟器、连接到、主机

2023-09-11 10:50:32 作者:醉城

我能做些什么在Eclipse的Andr​​oid模拟器将其连接到我的本地Web服务器页面的http://本地主机的http:// 127.0.0.1

What can I do in Eclipse's Android emulator to connect it to my localhost web server page at http://localhost or http://127.0.0.1?

我已经试过了,但模拟器仍然需要我的要求,像谷歌搜索本地主机还是坏,它说,它没有找到的页面,而我的Web服务器运行正常。

I've tried it, but the emulator still takes my request like a Google search for localhost or worse it says that it didn't found the page while my web server is normally running.

推荐答案

的本地主机是指在其上code为运行装置中,在这种情况下,仿真器。

The localhost refers to the device on which the code is running, in this case the emulator.

如果您想引用其运行Android模拟器的电脑,使用IP地址10.0.2.2来代替。你可以阅读更多从这里。

If you want to refer to the computer which is running the Android simulator, use the IP address 10.0.2.2 instead. You can read more from here.