httpconnection refused on android device when connecting with localhost -
i making app requires connection localhost
on pc. working fine emulator when trying out in real device throwing exception:
org.apache.http.conn.httphostconnectexception: connection http://192.168.xx.xx:8090 refused, network host unreachable etc etc
where 8090
port in apache tomcat running , 192.168.xx.xx
pc's ip address. have tried out many things none worked. i'm using usb connection not wifi access localhost device.
please help!!!! thanks
have looked @ similar questions linked stackoverflow, such cannot access localhost android device or how can access localhost android device??
this question not have single answer, there can many different problems. not list tried exclude. also, can paste actual error without removing technical details? can omit stack trace. can add line doing connection?
as first step, since message says "network host unreachable" should check phone can access computer @ all. try navigating http://192.168.xx.xx:8090
phone's browser, if succeeds there's problem in app (the code, permissions, etc.). if fails have more subquestions, general network troubleshooting questions: - can phone indeed reach ip of pc? if yes: - webserver listen outside connections? if yes: - blocking connection between phone , webserver? there firewall involved? one, understanding how networking works "inside", is, nodes supposed relay packets other side, tell nodes might not doing job. (with usb connection, that's 2 hosts themselves).
maybe did of experiments , excluded of these hypotheses. if so, helpful describe experiments. if not doing that, , want learn troubleshoot better, might scientific method troubleshooting (google "troubleshooting scientific method", there several essays helpful, this).
Comments
Post a Comment