How do I know if the SD card is present or not through Android code/API?

  • Thread starter Thread starter AC Question
  • Start date Start date
A

AC Question

how to know SD card is present or not through android code/API?

I have a requirement to find whether SD card is present or not in phone in an Android application.
I have used following to check it, but it returns true, even if SD card is not present.

android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED)

I did not find any proper solution which will work on different OEM's phone and tablet.

Quick help will be appreciated!
 

Trending Posts

Forum statistics

Threads
962,259
Messages
6,989,545
Members
3,164,796
Latest member
mhp