Search code examples
androidstorageandroid-sdcard

How to check if SD card inserted in Android?


I want to check if the phone has SD card inserted or not. Actually I want to provide user to select the storage location.


Solution

  • This question has several duplicates, however, you can check for the SD card like this:

    Boolean isSDPresent = android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED);