在android模拟器中测试本地主机

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2234742/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 05:05:13  来源:igfitidea点击:

test the localhost in android emulator

androidstrutslocalhost

提问by saravanan

My web application runs in localhost server. In my emulator the URL is http://localhost:8080/myaction

我的 Web 应用程序在 localhost 服务器中运行。在我的模拟器中,URL 是http://localhost:8080/myaction

Is it possible to retrieve the information from the server?

是否可以从服务器检索信息?

回答by Nikola Smiljani?

Localhost is device's own loopback interface, if you're trying to access your development machine use 10.0.2.2.

Localhost 是设备自己的环回接口,如果您尝试访问您的开发机器,请使用 10.0.2.2。

More about it here.

更多关于它在这里