мне удалось сделать это с помощью этого кода:
public File getSDPath() {
String filepath = Environment.getExternalStorageDirectory()
.getAbsolutePath();
if (android.os.Build.DEVICE.contains("samsung")
|| android.os.Build.MANUFACTURER.contains("samsung")) {
File f = new File(Environment.getExternalStorageDirectory()
.getParent() + "/extSdCard");
if (f.exists() && f.isDirectory()) {
try {
File file = new File(f, "test");
FileOutputStream fos = new FileOutputStream(file);
filepath = Environment.getExternalStorageDirectory()
.getParent() + "/extSdCard";
} catch (FileNotFoundException e) {
}
} else {
f = new File(Environment.getExternalStorageDirectory()
.getAbsolutePath() + "/external_sd");
if (f.exists() && f.isDirectory()) {
try {
File file = new File(f, "test");
FileOutputStream fos = new FileOutputStream(file);
filepath = Environment.getExternalStorageDirectory()
.getAbsolutePath() + "/external_sd";
} catch (FileNotFoundException e) {
}
}
}
}
return new File(filepath);
}
[Внешнее запоминающее устройство] (http://commonsware.com/blog/2014/04/08/ storage-situation-external-storage.html) обычно не является [сменным хранилищем] (http://commonsware.com/blog/2014/04/09/storage-situation-removable-storage.html). – CommonsWare