[英]: java.net.UnknownHostException: Unable to resolve host “hosturl”: No address associated with hostname
I have android application which connect to "hosturl"
over the web. 我有android应用程序通过Web连接到"hosturl"
。 This application can connect to hosturl
in the initial steps, but after i try to test it for some time(say 20 or more requests), I get above exception and I can not no longer connect to above url. 这个应用程序可以在初始步骤中连接到hosturl
,但在我尝试测试它一段时间后(比如20个或更多请求),我得到了异常,我不能再连接到上面的url了。
If i restart my android handset, then application can again connect to the "hosturl"
but again I get the exception after I have tried to connect to hosturl
few number of times 如果我重新启动我的Android手机,那么应用程序可以再次连接到"hosturl"
但是在我尝试连接到hosturl
的次数之后我再次获得异常
Could anybody help me here If you have encounter such a behavior with an android application before. 任何人都可以帮助我吗?如果你之前遇到过Android应用程序的这种行为。
You probably don't have the INTERNET permission. 您可能没有INTERNET权限。 Try adding this to your AndroidManifest.xml file, right before </manifest>
: 尝试在</manifest>
之前将其添加到AndroidManifest.xml文件中:
<uses-permission android:name="android.permission.INTERNET" />
我遇到了这个,我刚关闭了我的AVD并再次启动它并且它有效...
Check your Internet connection. 检查您的Internet连接。 Check Wifi. 检查Wifi。 Check Server. 检查服务器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.