Public Sub GetDBFolder As String
#If B4A
Dim pid As Phone
Dim rp As RuntimePermissions
If File.ExternalWritable Then
If pid.SdkVersion >= 23 Then
Return rp.GetSafeDirDefaultExternal("")
Else
Return File.DirDefaultExternal
End If
Else
Return File.DirInternal
End If
#Else If B4i
Return File.DirDocuments
#End If
End Sub