Open nologinatgit opened 10 years ago
virtualizing the data retrieval
? Did you mean visualizing?
.count()
instead of .execute
. >200
per batch..limit
and .offset
to fetch 0...200, 200...400, count-200...count. Each time you fetched it, update the display (you can use progress
on the AsyncTask
.However, 2000 records should be fairly quick. Are you sure you have an @Column( index = true )
on your Data_Id
field?
Use SimpleCursorAdapter, CursorLoader and LoaderManager to avoid loading all objects to memory.
https://github.com/pardom/ActiveAndroid/wiki/Using-the-content-provider
As far as I know, Android listview shows the data virtualized (meaning it loads only the visible ones), so it is fast as it can be.
I have lots of data to get from the database (around 2000 but with lots of data in the fields), and I use ActiveAndroid in an AsyncTask to get them.
Unfortunately the AsyncTask with AA takes around 10-15 seconds to get the data so I see a progressbar during that time.
I get his by this code:
It would be good to accelerate the loading by somehow virtualizing the data retrieval.
I also use a search in the listview, that searches the whole list. So considering the would be also good.
What do you suggest? How should I proceed?