Android应用程序:SocketException权限被拒绝(没有这样的文件或目录) [英] Android application: SocketException permission denied (No such file or directory)

查看:131
本文介绍了Android应用程序:SocketException权限被拒绝(没有这样的文件或目录)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用code书面和费多尔上传张贴在这个线程 <一href="http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview">http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview (来源$ C ​​$ C: http://open-pim.com/tmp/LazyList.zip

I am trying to use the code written and uploaded by Fedor posted in this thread http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview (Source code: http://open-pim.com/tmp/LazyList.zip)

费多尔的项目运作良好,但是当我尝试适应code到我的项目,事情没有办好,因为我碰到这种异常(SocketException)。

Fedor's project works well, but when I try to adapt the code to my project, things are not running well since I bumped to this exception (SocketException).

不知怎的,我保持均匀设置权限在清单中有Internet权限后得到它(是的,我有一个Internet连接工作):

Somehow, I keep getting it even after setting the permission in the manifest to have Internet permission (and yes, I have an Internet connection working):

<uses-sdk android:minSdkVersion="8">
    <uses-permission android:name="android.permission.INTERNET"></uses-permission> 
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
</uses-sdk>

的异常:SocketException:权限被拒绝。观看LogCat中的细节。

The exception: SocketException: Permission denied. Watch the LogCat details.

09-24 23:43:00.591: ERROR/File was not found.(1124): /mnt/sdcard/ListViewTest/-421624214 (No such file or directory)
09-24 23:43:00.601: WARN/System.err(1124): java.net.SocketException: Permission denied
09-24 23:43:00.611: WARN/System.err(1124):     at org.apache.harmony.luni.platform.OSNetworkSystem.createStreamSocketImpl(Native Method)
09-24 23:43:00.611: WARN/System.err(1124):     at org.apache.harmony.luni.platform.OSNetworkSystem.createStreamSocket(OSNetworkSystem.java:186)
09-24 23:43:00.622: WARN/System.err(1124):     at org.apache.harmony.luni.net.PlainSocketImpl.create(PlainSocketImpl.java:265)
09-24 23:43:00.632: WARN/System.err(1124):     at java.net.Socket.checkClosedAndCreate(Socket.java:873)
09-24 23:43:00.632: WARN/System.err(1124):     at java.net.Socket.connect(Socket.java:1020)
09-24 23:43:00.632: WARN/System.err(1124):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:62)
09-24 23:43:00.642: WARN/System.err(1124):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:88)
09-24 23:43:00.642: WARN/System.err(1124):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHTTPConnection(HttpURLConnectionImpl.java:927)
09-24 23:43:00.652: WARN/System.err(1124):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:909)
09-24 23:43:00.661: WARN/System.err(1124):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:1152)
09-24 23:43:00.661: WARN/System.err(1124):     at java.net.URL.openStream(URL.java:653)
09-24 23:43:00.661: WARN/System.err(1124):     at fabiomilheiro.tests.ImageLoader.getBitmap(ImageLoader.java:80)
09-24 23:43:00.671: WARN/System.err(1124):     at fabiomilheiro.tests.ImageLoader.access$0(ImageLoader.java:66)
09-24 23:43:00.671: WARN/System.err(1124):     at fabiomilheiro.tests.ImageLoader$PhotosLoader.run(ImageLoader.java:173)

错误的/ mnt / SD卡/ ListViewTest / -421624214(没有这样的文件或目录)被缠着我。我调试我的费多尔的code适应,我不明白是为什么找不到文件。我检查和确认,我试图让确实存在在网络上的文件。

The error /mnt/sdcard/ListViewTest/-421624214 (No such file or directory) is bugging me. I debugged my adaptation of Fedor's code and I don't see why the files are not found. I checked and confirmed the files I am trying to get do exist on the web.

顺便说一下,图像上载类是完全一样的。我与我的code和费多尔的code看到的主要区别是,我的主要活动类扩展ListActivity而和他伸出BaseActivity。

By the way, the image uploader class is exactly the same. The main difference I see between my code and Fedor's code is that my main activity class extends ListActivity while and his extends BaseActivity.

推荐答案

我不知道这是否解决您的问题,但在你的清单,使用,许可,指令不应该放在用途-SDK指令里面。

I don't know if it solves your issue, but in your manifest, uses-permission directives should not be placed inside the uses-sdk directive.

这篇关于Android应用程序:SocketException权限被拒绝(没有这样的文件或目录)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆