无法访问 Android 中同一网络中可用的 Web 服务
我使用的是 Android 2.1 平板电脑。我创建了访问我自己的网络服务的简单应用程序。它在模拟器中运行良好。但在安卓设备上却失败了。我收到超时异常。我有互联网许可和超时许可,正如少数论坛消息所提到的。我已禁用网络防火墙。尽管我无法从终端模拟器 ping 它来检查网络可用性。 我还尝试通过 Android 设备中的浏览器访问 webservice 基本 url。这不起作用。我在笔记本电脑的端口 9080 上运行 Web 服务,该笔记本电脑连接到与 Android 设备相同的 wifi 网络。 我绝对一无所知。任何帮助将不胜感激。
I am using Android 2.1 tablet. I have created simple application which access my own webservice. It works well in emulator. But it fails on android device. I am getting timeout exception. I have internet permission and timeout permission as mentioned is few forum message. I have disabled firewall for my network. Though I couldn't ping it from Terminal emulator to check the network availability.
Also I tried access the webservice base url via browser in android device. It doesn't work. I have webservice running on port 9080 in a laptop which is connected to same wifi network as android device.
I am absolute clueless. Any help would be highly appreciated.
如果模拟器与 Web 服务在同一台计算机上运行,那么您的 Web 服务可能只接受来自
localhost
的连接。If the emulator was running on the same machine as the Web service, then perhaps your Web service is only accepting connections from
localhost
.