我想在Android中使用的HttpURLConnection
来下载一个文件来访问http链接,但得到的 LogCat中:
I am trying to access http link using HttpURLConnection
in Android to download a file, but getting this warning in LogCat
:
WARN / System.err的(223):java.net.SocketException异常:权限被拒绝(也许缺少INTERNET权限)
WARN/System.err(223): java.net.SocketException: Permission denied (maybe missing INTERNET permission)
我已经加入android.Manifest.permission到我的应用程序,但它仍然给了同样的异常。
I have added android.Manifest.permission to my application but its still giving the same exception.
假如,你没有从你的 LogCat中
错误描述设置权限,这是我的内容,我 AndroidMainfest.xml
文件,该文件有访问互联网:
Assuming, you do not have permissions set from your LogCat
error description, here is my contents for my AndroidMainfest.xml
file that has access to the internet:
<manifest xlmns:android...>
...
<uses-permission android:name="android.permission.INTERNET" />
<application ...
</manifest>
除此之外,你应该罚款从互联网上下载文件。
Other than that, you should be fine to download a file from the internet.
上一篇:安卓:检测时,滚动型会停止滚动
下一篇:谷歌眼镜API眼镜、API