I was writing a set of functions for accessing/writing data to the SQLite database in my android application. Since I need to use getWritableDatabase()
to get the database instance and this needs to be called in a non-UI thread, I was wondering if there a clean way to specify the same warning in the java docs of these functions?
Also, I needed one more clarification about getting handle over the database instance using getWritableDatabase()
. I should call this wherever I need to write things into database right? Or can I call this once at the application level and use the same handle to access db at different places in the app?