When I connect to a file-based SQLiteDatabase db, what’s common practice:
a) Check with db.connect every time before I run an SQL statement
b) Do db.connect once when I start the app and it will never disconnect.
I mean, the real question is, will a file-based SQLiteDatabase ever disconnect, for example, when the user exits the app and comes back later?
So, if I understand properly, it’s like this: only if the app is being closed completely, i.e., it is not open any longer in the background (task manager), only then will the database disconnect.
As long as the user exits the app but the app is still accessible through the task manager, the database connection is also still there. Which means, as you both say, I will only connect to the database file in the App.Open event handler.