三星Galaxy S3拥有extrenal SD卡插槽,可安装到的/ mnt / extSdCard
。
Samsung Galaxy S3 has an extrenal SD card slot, which is mounted to /mnt/extSdCard
.
我的问题是:如何通过类似 Environment.getExternalStorageDirectory得到这个路径()
?这将返回 MNT / SD卡
,我找不到外接SD卡的API。 (或可移动USB存储设备上的一些片)
My question is: how to get this path by something like Environment.getExternalStorageDirectory()
? This will return mnt/sdcard
, and I can't find API for external SD card. (Or removable USB storage on some tablets)
感谢您!
推荐答案
我想用你需要使用这个外部SD卡:
I guess to use the external sdcard you need to use this:
new File("/mnt/external_sd/")
或
new File("/mnt/extSdCard/")
在你的情况......
in your case...
在替换 Environment.getExternalStorageDirectory的()
我的作品。您应该检查什么在目录MNT第一和工作从那里。
Works for me. You should check whats in the directory mnt first and work from there..
您应该使用某种类型的选择方法,选择要使用的SD卡:
You should use some type of selection method to choose which sdcard to use:
File storageDir = new File("/mnt/");
if(storageDir.isDirectory()){
String[] dirList = storageDir.list();
//TODO some type of selecton method?
}
相关推荐
最新文章