192.168.x.x network is a private network and cannot be accessed outside, i.e from actual android device in your case.
Android simulator works on your computer that is a part of the private network, so the 192.168.56.1 server is accessible. But actual android device works outside of your private network.
Place your webservice on a server with a real ip-address, or setup a firewall on the server with real ip-address to implement a passthrough connection via this real ip-address and port to your internal private network resource.
发布评论
评论(1)
192.168.xx 网络是专用网络,无法从外部访问,即从您的实际 Android 设备访问案件。
Android模拟器在您的计算机上运行,该计算机是专用网络的一部分,因此可以访问192.168.56.1服务器。但实际的 Android 设备可以在您的专用网络之外运行。
将您的网络服务放置在具有真实IP地址,或者在具有真实IP地址的服务器上设置防火墙,以通过该真实IP地址和端口实现到您的内部专用网络资源的直通连接。
192.168.x.x network is a private network and cannot be accessed outside, i.e from actual android device in your case.
Android simulator works on your computer that is a part of the private network, so the 192.168.56.1 server is accessible. But actual android device works outside of your private network.
Place your webservice on a server with a real ip-address, or setup a firewall on the server with real ip-address to implement a passthrough connection via this real ip-address and port to your internal private network resource.