Sub Which_Storage As Boolean
'Define Storage: Phone storage (=true) or SD card (false).
Dim AllExternal() As String = rpRuntimePermissions.GetAllSafeDirsExternal("")
Dim PersistantUri As String
Dim ExternalDir As String 'External storage.
Dim sText As String 'The "Identifier" of the folder.
Dim iPos As Int
'Read the contents of the PersistantUri file - the URI of the previous (current) folder.
PersistantUri = File.ReadString(File.DirInternal, "PersistantUri")
sText = PersistantUri
'Delete the text on the right, starting with "%".
sText = sf.Left(sText, sf.InString(sText, "%"))
'Delete all texts containing "/" on the left.
iPos = sf.InString(sText, "/")
Do While iPos>=0
sText = sf.Right(sText, sText.Length-iPos-1)
'Log("sText - " & sText)
'Log("Stop")
iPos = sf.InString(sText, "/")
Loop
'We form the "Identifier" of the folder.
sText = "/" & sText
If AllExternal.Length >1 Then
'There is an external SD card.
ExternalDir = AllExternal(1)
If sf.InString(ExternalDir, sText) >= 0 Then
'The current folder is on the SD card.
Return False
Else
'The current folder is in Phone Memory.
Return True
End If
Else
'No SD card.
Return True
End If
End Sub