Search code examples
androidmemorymemory-managementsd-cardandroid-sdcard

Check sdcard presence in ice cream (no sdcard support)


Well I read that some new phones that will ice cream (4.0), will not have any sdcard. The memory will be all internal or something like that. However it is there will not be a possibility to add sdcard at least I read abouth that

Boolean isSDPresent = android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED);
if(isSDPresent)
{
  // yes SD-card is present
}
else
{
 // Sorry
}

But I guess this code check is there if the sdcard is present or not. I want to foundout if the device have sdcard slot or not. Does ice cream gives some api about this ?

here phone with no sdcard.


Solution

  • Well I read that some new phones that will ice cream (4.0), will not have any sdcard.

    There have been Android devices without an SD card slot for ~18 months, as of the time I wrote this.

    The memory will be all internal or something like that.

    All Android devices have external storage. However, "external" means "can be accessed via USB cable", not "can be physically removed from the device".

    But I guess this code check is there if the sdcard is present or not.

    No, it indicates if external storage is available. On Android 1.x and 2.x devices, if the user has mounted external storage as a drive on a host machine (e.g., it is now their F: drive on Windows), then external storage is not available to Android applications.

    This is covered in the Android developer documentation, among other places.

    I want to foundout if the device have sdcard slot or not. Does ice cream gives some api about this ?

    No version of Android has no concept of an "SD card slot".