Android: absolute location of External sd-card

Farhan  picture Farhan · Aug 31, 2011 · Viewed 17.2k times · Source

I have a very simple question but so far I am unable to find an answer of this question. "Is there any way of finding the absolute path of INTERNAL STORAGE DIRECTORY and EXTERNAL STORAGE DIRECTORY(SDCARD) in Android?"

Please don't recommend using Environment.getExternalStorageDirectory since it usually returns the path for internal storage or WHATEVER storage media is selected as default by the Android operating system..

Any suggestions please?

Answer

Nikolay Elenkov picture Nikolay Elenkov · Aug 31, 2011

That's been asked before on SO, use the search. In short, 'external storage' is more like 'shared storage' and it may or may not be implemented by an actual SD card. Some devices have an additional SD card, not used as external storage. If that is what you are asking for, there is currently no public API for accessing its mount location, and it varies between devices. You can check /proc/mount to see what is currently mounted and go from there.