Sub GetSDCardFolder() As String
'*************************************************************
'Try to find the location of removable external sdcard memory,
'*************************************************************
Dim root As String
Dim folder As String
Dim sdf As String
'------------------------------------
'DEFAULT
'-------------------------------------
root = File.DirRootExternal
folder = ""
If File.IsDirectory(root,folder) Then
sdf=root & "/" & folder
If Writetest(sdf) Then Return sdf
End If
'------------------------------------
'HTC Desire
'-------------------------------------
root = "/mnt"
folder = "sdcard"
If File.IsDirectory(root,folder) Then
sdf=root & "/" & folder
If Writetest(sdf) Then Return sdf
End If
'------------------------------------
' Acer A500 Tablet
'------------------------------------
root = "/mnt"
folder = "external_sd"
If File.IsDirectory(root,folder) Then
sdf=root & "/" & folder
If Writetest(sdf) Then Return sdf
End If
'------------------------------------
'Samsung Galaxy S2
'-------------------------------------
root = File.DirRootExternal
folder = "external_sd"
If File.IsDirectory(root,folder) Then
sdf=root & "/" & folder
If Writetest(sdf) Then Return sdf
End If
'-------------------------------------
' ASUS TF 101 (Micro SD)
'-------------------------------------
root = "/mnt/sdcard/Removable"
folder = "MicroSD"
If File.IsDirectory(root,folder) Then
sdf=root & "/" & folder
If Writetest(sdf) Then Return sdf
End If
'-------------------------------------
'HTC
'-------------------------------------
root = File.DirRootExternal
folder = "sd"
If File.IsDirectory(root,folder) Then
sdf=root & "/" & folder
If Writetest(sdf) Then Return sdf
End If
'-------------------------------------
'MOTOROLA DROID 3
'-------------------------------------
root = "/mnt"
folder = "sdcard-ext"
If File.IsDirectory(root,folder) Then
sdf=root & "/" & folder
If Writetest(sdf) Then Return sdf
End If
'------------------------------------
' Flytouch 3 Tablet
'------------------------------------
root = "/mnt"
folder = "sdcard1"
If File.IsDirectory(root,folder) Then
sdf=root & "/" & folder
If Writetest(sdf) Then Return sdf
End If
'------------------------------------
' Flytouch 3 Tablet #2
'------------------------------------
root = "/mnt"
folder = "sdcard/sdcard1"
If File.IsDirectory(root,folder) Then
sdf=root & "/" & folder
If Writetest(sdf) Then Return sdf
End If
'------------------------------------
' LG 3D Tablet
'------------------------------------
root = "/mnt"
folder = "sdcard/_ExternalSD"
If File.IsDirectory(root,folder) Then
sdf=root & "/" & folder
If Writetest(sdf) Then Return sdf
End If
End Sub
Sub WriteTest(dirname As String)
As BooleanDim s As String
Try
File.WriteString(dirname,"test.tmp","test")
s=File.ReadString(dirname,"test.tmp")
File.Delete(dirname,"test.tmp")
Catch
Log(LastException.Message)
Return False
End Try
If s="test" Then return true
End Sub