android localhost asp.net

0

I am trying to connect an android app with a web service ASP.Net with JSON .

How could I do it to work in local? Using URLs as localhost: port, ip_of_my_team or 10.0.2.2 does not work for me. Any alternative or clue to what may be failing? When I try it I get this in the logcat:

  

W / System.err: Caused by: android.system.ErrnoException: isConnected failed: ECONNREFUSED (Connection refused)

    
asked by Juan 12.04.2018 в 17:51
source

1 answer

0

You should make sure that both the machine with the web service and the android device are in the same network, that the application points to the IP of the server in the internal network and that there is no firewall between them (in the router or the windows firewall itself) And, of course, use the IP and not localhost.

    
answered by 13.04.2018 в 09:28