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:
LocalDateTime start=new LocalDateTime();
LogCat("Start: "+start);
elements = new Select().from(Data.class)
.where("Data_Id=?", DataId).orderBy("Name ASC").execute();
LogCat("Elements: "+elements .size());
LocalDateTime end=new LocalDateTime();
LogCat("End: "+end);
LogCat("Time: "+(new Period(start,end).getSeconds()+" s"));
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?