android模拟器-任何可访问的存储空间?
我
java.io.FileNotFoundException: /sdcard/Img_1316563834614.jpg (Permission denied)
在尝试
mRAF = new RandomAccessFile(mFullPath, "rws");
mFullPath 是 /sdcard/image6456.jpg、/mnt/sdcard/image3579.jpg、file:///sdcard/image34567.jpg 等之后得到的结果。没有任何效果。 已经有
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
AndroidManifest.xml 中
一行我已经检查过路径 /mnt/sdcard 实际上在那里。调用也
getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS);
给出了 null。但我不应该想知道......
我错过了什么?
谢谢
I am getting
java.io.FileNotFoundException: /sdcard/Img_1316563834614.jpg (Permission denied)
after trying
mRAF = new RandomAccessFile(mFullPath, "rws");
where mFullPath was /sdcard/image6456.jpg, /mnt/sdcard/image3579.jpg, file:///sdcard/image34567.jpg, etc. Nothing works. There is already an
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
line in AndroidManifest.xml
I have checked that the path /mnt/sdcard is actually there. Also the call
getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS);
gives out null. I should not wonder though...
What am I missing ?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
模拟器不附带外部存储,除非您在 AVD 中定义了一些外部存储。请参阅“添加 Android 虚拟设备”或“编辑 Android 虚拟设备”对话框中的“SD 卡”组框:
此处输入图像描述">
The emulator does not come with external storage, unless you define some in the AVD. See the "SD Card" group box in the Add Android Virtual Device or Edit Android Virtual Device dialogs:
In this one, I defined 32MB of external storage. By default, the Size field is blank, meaning no external storage.