kellogs
kellogs

Reputation: 2857

android emulator - any accessible storage space?

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

Upvotes: 2

Views: 1703

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006584

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:

enter image description here

In this one, I defined 32MB of external storage. By default, the Size field is blank, meaning no external storage.

Upvotes: 5

Related Questions