简体   繁体   English

在Android上拒绝Http连接

[英]Http Connection Refused on Android

I am having a problem to connect to the server via android application which is running on a phone. 我在通过手机上运行的android应用程序连接服务器时遇到问题。

Why my browser on my phone can connect to the server, but my program can not connected to the server? 为什么我手机上的浏览器可以连接到服务器,但是我的程序无法连接到服务器? org.apache.http.conn.HttpHostConnectException: Connection to http://192.168.XX.XX:82 refused, network host unreachable etc etc

For the possible case may occur check it. 对于可能发生的情况,请检查它。

Is that IP address accessible to outside world? 该IP地址是否可供外界访问?

Just a guess: I think the IP address, you were using might have been reserved. 只是一个猜测:我认为您使用的IP地址可能已被保留。 It worked in emulator cause you were still in the network (probably in your office). 它在模拟器中起作用,因为您仍在网络中(可能在您的办公室中)。 As you came outside the network with your real device it didn't work. 当您使用真实设备来到网络之外时,它就无法工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM