How to check SDcard exist on Android device.

Total Post:47

Points:331
 1289  View(s)
Ratings:
Rate this:
I want to create a folder in sdcard programmatically but before create folder I want to know sdcard is available or not.
  1. Post:26

    Points:188
    Re: How to check SDcard exist on Android device.

    Hi Pooja, follow below code to check sd card available or not

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

     

     

     

      Modified On Apr-10-2018 12:17:34 AM

Answer