I use the following code to check if the SD card is available but on a Samsung Galaxy II and Note devices that run Android 4.x and later the OS simulate having a SD card even if in reality there is no SD card on the device.
private boolean isSDCardAvailable() {
return android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED);
}
If SD card is available I then call getExternalCacheDir() get the directory else I display erro r to the user and call getCacheDir() to use internal storage.
The method above return TRUE and ALL devices even if they don’t have a SD card.
see this method is available since API level 11, which let you know if Internal Memory working as External storage. in some devices
getExternalStorageDirectory()returns true even if SD-Card is not available. read below docs for details.Certain system services, such as the package manager, use this to determine where to install an application.
Android docs