My Apps have databases with sqlite,
Now there are always times before that a User
reported that after starting the app no more data are there.
Possibly happens after an Android update, if you could
has changed the structure of the file system.
Are then when start the app, the database files not found
and are found then applied new, they are of course empty.
The question now is, how can I prevent that ?
Here is my code when initializing the database files:
Now there are always times before that a User
reported that after starting the app no more data are there.
Possibly happens after an Android update, if you could
has changed the structure of the file system.
Are then when start the app, the database files not found
and are found then applied new, they are of course empty.
The question now is, how can I prevent that ?
Here is my code when initializing the database files:
B4X:
If File.Exists(File.DirDefaultExternal, "staende.db") = False Then 'wenn Zählerstände DB nicht vorhanden
If SQLstaende.IsInitialized = False Then
SQLstaende.Initialize(File.DirDefaultExternal, "staende.db", True) 'Zählerstände DB initialisieren
End If
SQLstaende.ExecNonQuery("DROP TABLE IF EXISTS Staende")
SQLstaende.ExecNonQuery("CREATE TABLE staende (ticksdatum TEXT, ...")
Else
If SQLstaende.IsInitialized = False Then
SQLstaende.Initialize(File.DirDefaultExternal, "staende.db", True) 'Zählerstände DB initialisieren
End If
End If