Hello together,
I have a problem - I cannot copy my database (SQLite) from File.Assents folder to public folder.
Normally if run the app on my device - the database exsits and everything works fine.
Now I would like to move the database to an public folder because since Android 11 I don't have access to app folder via FTP connection.
Many thanks and best regards
Gabriel
I have a problem - I cannot copy my database (SQLite) from File.Assents folder to public folder.
Normally if run the app on my device - the database exsits and everything works fine.
Now I would like to move the database to an public folder because since Android 11 I don't have access to app folder via FTP connection.
B4X:
NewDBFolder = File.DirRootExternal & "/TestFolder/"
If File.Exists(NewDBFolder, "") = False Then
File.MakeDir(NewDBFolder, "")
End If
If File.Exists(NewDBFolder, "MyDatabase.db") = False Then
If File.Exists(File.DirAssets, "MyDatabase.db") Then
Wait For (File.CopyAsync(File.DirAssets, "MyDatabase.db", NewDBFolder, "MyDatabase.db")) Complete (Success As Boolean)
bStartCopy = True
Else if File.Exists(SourceFolder, "MyDatabase.db") Then
Wait For (File.CopyAsync(SourceFolder, "MyDatabase.db", NewDBFolder, "MyDatabase.db")) Complete (Success As Boolean)
bStartCopy = True
Else if File.Exists(File.DirInternal, "MyDatabase.db") Then
Wait For (File.CopyAsync(File.DirInternal, "MyDatabase.db", NewDBFolder, "MyDatabase.db")) Complete (Success As Boolean)
bStartCopy = True
Else
Msgbox2Async("Cannot find database", "Fehler - Folder error", "OK", "", "", info, False)
Wait For Msgbox_Result (iResult As Int)
If iResult = DialogResponse.POSITIVE Then
bStartCopy = False
End If
End If
End If
Many thanks and best regards
Gabriel