0

I have an Android app with SQL Lite database. I want to access it in background thread to populate listView.

What should I use: AsycnTask, Thread or Service?

Unheilig
  • 16,196
  • 193
  • 68
  • 98
Lelk Lelk
  • 21
  • 4
  • possible duplicate of [What are the best practices for SQLite on Android?](http://stackoverflow.com/questions/2493331/what-are-the-best-practices-for-sqlite-on-android) – Ed Holloway-George Apr 10 '15 at 10:33

2 Answers2

0

Best combination would be, ListFragment, Sqlite (with or without content provider), CursorLoader, CursorAdapter, Service.

suresh
  • 266
  • 1
  • 7
0

Most of time I prefer to use Loaders here are some sample Example Loader and LoaderManager with Cursor and tutorial Android Design Patterns : Why Loaders.

Loader characteristics

  1. They are available to every Activity and Fragment.
  2. They provide asynchronous loading of data.
  3. They monitor the source of their data and deliver new results when the content changes.
  4. They automatically reconnect to the last loader's cursor when being recreated after a configuration change. Thus, they don't need to re-query their data.
Bharatesh
  • 8,943
  • 3
  • 38
  • 67