Pregunta

My Android code makes a web service call when I run the code on my local Android Emulator using the URL: http://192.168.56.1/test/Service1.asmx .When I run the code in my emulator I get the desired output with the above URL but when I install app on my smartphone and tried using the same then there was an error saying connection refused. I have opened port 80 on my Windows 7 machine through the Firewall Settings.

Now I need to know how to unblock the firewall of my Mcafee AntiVirus such that the error of connection refusal is not present.

Can anyone please help ?

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top