Java unknown host exception

前端 未结 3 657
广开言路
广开言路 2021-01-07 21:59

I am trying to access textalertapp.com via HTTP Post request from my android application. But I am getting Unknown host error. Can anybody help me solve this issue.

相关标签:
3条回答
  • 2021-01-07 22:38

    This means that your host is unknown, i.e. does not exist or is not accessible. Check you IP again and check whether you can get this IP from your device. Probably this IP exists in your local network and is not accessible from outside.

    If IP exists check firewall definitions. Firewall cause the same effect.

    0 讨论(0)
  • 2021-01-07 22:49
    <uses-permission android:name="android.permission.INTERNET"></uses-permission>
    

    I just added this line in manifest file. Problem solved

    0 讨论(0)
  • 2021-01-07 23:02

    I just started receiving the "java.net.UnknownHostException" error when fetching content from a URL that previously worked perfectly.

    After going around in circles for a while, I manually deleted my project's /bin folder and cleaned the project in Eclipse (Project -> Clean), which fixed this error.

    0 讨论(0)
提交回复
热议问题