I’m building an app that contains a listview that is populated from a database query. The list works fine but I’m worried that I may start to display too much data when database gets larger. I would like to display the top 25 entries then add a list item called “show more” at the bottom of the list where I could append the next 25…
Is it better to preform a second database query for the next 25 and append them to the current list?
Or
Store the entire returned dataset in the ArrayList object on the initial database query and update the ListVew by cycling through the arraylist?
On a large dataset in your database, it will be too much to cache the entire database at once and show more upon the user’s request. You have a couple options, I would cache the first 50, and show the first 25. when the user decides to “see more”, show entries 0-50 and then cache 51-75. That way there is no real lag time for the user and you dont need to cache your entire db at once