android emulator - any accessible storage space?

孤街浪徒 提交于 2019-12-13 16:32:07

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/7493225/android-emulator-any-accessible-storage-space

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!