Hi everybody! I would like to know better ways to use SQLite in Android. I've got some UI Activities and background service (Android service which runs some AsyncTasks to change the data, they also can use database concurrently )
First I tried to use all this stuff as is, just open cursor in ListActivity, show data. My AsyncTasks were doing some changes to my local sqlite db. So, sometimes I was getting: DATABASE IS LOCKED exception. Then I tried to synchronize all my update/insert/delete parts of my AsyncTasks. So my app got better, almost everything was working wonderfull. But, some users were sending error messages with all the same exception. So, I finished with such solution for now: I do not hold any Cursors open. I open it, read to my arraylists, then close. So I also tried to synchronize read methods. Now everything is working fine, no "DATABASE IS LOCKED" exception. But, I don't like such solution, first of all because of performance issues. Opening cursor and getting all data from it to arraylist is not very cool and fast. May be I missed something?! How do you use sqlite in Android? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

