java.net.ConnectException:本地主机/ 127.0.0.1:8080 - 连接被拒绝 [英] java.net.ConnectException: localhost/127.0.0.1:8080 - Connection refused
问题描述
我使用的XAMPP Apache服务器服务资源,从我的机器上的应用程序。但是,我得到上述错误。
I am using xampp apache server to serve resources to the application from my machine. But i am getting the above error.
我得到的东西在谷歌。对可能的解决方案指指点点 <一href="http://groups.google.com/group/android-beginners/browse_thread/thread/599a06416fb37b4a">http://groups.google.com/group/android-beginners/browse_thread/thread/599a06416fb37b4a
I got something on the google. pointing towards possible solution here http://groups.google.com/group/android-beginners/browse_thread/thread/599a06416fb37b4a
什么是上述问题的解决方案?
What is the solution for the above problem?
推荐答案
由于您没有指定的由设备或仿真器连接到服务器,我猜你正在使用您的应用程序模拟器。
Since you have not specified your are connecting to server from device or emulator and I guess you are using your application in emulator.
如果您是从Android模拟器指本地主机系统上,那么你必须使用 http://10.0.2.2:8080/
由于Android模拟器内运行虚拟机,因此在这里 127.0.0.1
或本地主机
将仿真器自身的回送地址。
If you are referring your localhost on your system from the Android emulator then you have to use http://10.0.2.2:8080/
Because Android emulator runs inside a Virtual Machine therefore here 127.0.0.1
or localhost
will be emulator's own loopback address.
请参考:模拟器联网
这篇关于java.net.ConnectException:本地主机/ 127.0.0.1:8080 - 连接被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!