How to detect SD Card?

rfresh

Well-Known Member
Licensed User
Longtime User
How can I detect if an Android device has an SD Card installed?

By default I'm assuming it does and am using this in my file I/O:

B4X:
File.DirRootExternal

...but I realize this will not work if there is no SD Card. I can switch over to using File.DirRootInternal if I can detect no card, right?

Thanks...
 

rfresh

Well-Known Member
Licensed User
Longtime User
Do I need a Lib for this? I'm getting an unknown member on the ExternalWritable part:

B4X:
   If File.ExternalWriteble = True Then
      Msgbox("SD Card Installed","Main Resume")
   Else
      Msgbox("No SD Card","Main Resume")   
   End If
 
Upvote 0
Top