Maurice Maurice - 14 days ago 6
Android Question

When should I close the DatabaseHelper?

With reference to this link, when is a good time to close the connection if you only have one connection? I have a service running in the background at all times. When is a good time to call the

close()
function? Any suggestions?

Answer

You do not actually have to call close(). For example, if you implement a content provider, there is no opportunity to call close(). We have been told that, due to the way SQLite is implemented, not calling close() will not cause any particular problem.

That being said, you really should reconsider having "a service running in the background too all the time".