HttpHostConnectException: Connection refused Android

前端 未结 5 730
礼貌的吻别
礼貌的吻别 2021-02-09 14:53

I am trying to connect via HttpPost and send a username and password to a website and then receive a string from that website. I have tried various methods that have worked for

5条回答
  •  长发绾君心
    2021-02-09 15:20

    I have identified the problem! So the issue is that I am using a dev server url that doesn't have a domain entry on the global DNS server.

    So there are two possible solutions to this issue:

    1) Editing the hosts file on the Android device (requires rooting your phone): How to change the hosts file on android

    2) Getting the server registered on the global DNS server. (also hard to do if you're not responsible for the url)

    Anyways I hope this helps someone else too!

提交回复
热议问题