how to emulate a real external sd (update: removable storage) card in Android Emulator

久未见 提交于 2019-12-07 09:36:49

问题


I try to emulate a external sdcard as it would be in a real device.

In a real device the external sdcard is not writeable except you use the new "Storage Access Framework" (API 21 & 22)

When I add an sdcard either with a file or Size ...

I always get a writeable sdcard, which is not true with a real device (I guess). I could create the Folder "CreateFolder" with just ( I know, I should not use the direct access, but this is only for a test to see if I have write access):

        String spathWriteTest="/storage/sdcard/";
        new File(spathWriteTest + "createFolder").mkdir();

Any Idea, howto emulate a real external sdcard ?


回答1:


When you set up an AVD, and it refers to an "SD card", it is really referring to external storage, not removable storage. The emulator does not emulate removable storage. You could see if Genymotion emulates removable storage.



来源:https://stackoverflow.com/questions/29924220/how-to-emulate-a-real-external-sd-update-removable-storage-card-in-android-em

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