2

How to programmatically check if an Android phone offers support for external SD card or not?

Please note that I do not wish to check if external SD card is added to the phone or not, I wish to find out if the phone offers support for the same.

EDIT: I want to make my question more clear. I want to know if the phone hardware supports external SD card or not.

SoulRayder
  • 5,072
  • 6
  • 47
  • 93

1 Answers1

-1

I found an indirect way of doing this:

As soon as you try to access the storage path

"/storage/external_SD"

if hardware support is not there for external SD card, you get an exception. So I found a way to solve my problem.

SoulRayder
  • 5,072
  • 6
  • 47
  • 93
  • 1
    Who said that that is the storage path? It could have been /storage/sdcard2 or /storage/extSdCard or many other paths. I think what you want is impossible. – greenapps May 21 '14 at 08:07
  • True, but in my case, I am working only on a specific brand of phones, wherein this path is uniform throughout. So it seems to be a decent solution, under the constrained conditions. – SoulRayder May 22 '14 at 04:49