问题描述
我试图模仿一个外部SD卡,因为这将是一个真正的设备。
I try to emulate a external sdcard as it would be in a real device.
在一个真实的设备,除非您使用新的存储访问架构外部SD卡是不可写(API 21安培; 22)
In a real device the external sdcard is not writeable except you use the new "Storage Access Framework" (API 21 & 22)
当我添加一个SD卡或者与文件或大小...
When I add an sdcard either with a file or Size ...
我总是得到一个可写SD卡,这是不是真的有一个真实的设备(我猜)。我可以创建文件夹CreateFolder只有(我知道,我不应该使用直接访问,但这只是一个测试,看看我是否有写权限):
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();
任何想法了,如何模拟实际的外部SD卡?
Any Idea, howto emulate a real external sdcard ?
推荐答案
当您建立了一个AVD,它指的是SD卡,它实际上指的,不是的。模拟器并不模拟移动存储。你可以看到,如果Genymotion模拟移动存储。
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.
这篇关于如何模拟一个真实的外置SD(更新:移动存储)卡在Android模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!