This link is taken from the Android setup guide. I assume this is recommended and not required.
https://source.android.com/devices/tech/storage/config-example.html
So, to get the sdcard, you can just do.
String storagePath = System.getenv("SECONDARY_STORAGE"); if (storagePath == null) { return null; } else { String[] storagePathArray = storagePath.split(":"); return storagePathArray[0]; }
EXTERNAL_STORAGE is like everything I have.
SECONDARY_STORAGE was defined on my LG GTab 8.3 and my Samsung Tab 2 and 3, but not on my Galaxy S (2.3) or in my Dell place (4.3). On Samsung devices, it seems that at first there were several paths with an SD card, so a split.
source share