What is best practice with SQLite and Android ?

Posted by PHP_Jedi on Stack Overflow See other posts from Stack Overflow or by PHP_Jedi
Published on 2010-03-22T15:13:32Z Indexed on 2010/03/23 0:01 UTC
Read the original article Hit count: 410

Filed under:
|
|

What is considered "best practice" when executing queries on a sql-lite db within an android app.

Is it safe to run inserts, deletes and select queries from an AsyncTask's doInBackground ? Or should I use the UI Thread ? I suppose that db queries can be "heavy" and should not use the UI thread as it can lock up the app - resulting in an ANR.

If I have several AsyncTasks, should they share a connection or should they open a connection each ?

Any best practices in this area on android?

© Stack Overflow or respective owner

Related posts about android

Related posts about sqlite3