Android SQLite and huge data sets

what options do we have in querying
and displaying tens of thousands of
rows of data in Android?

You mean besides telling you that reading 20,000+ rows on a 3.5″ LCD is bat-guano crazy? 😉

It looks like CursorWindow, which is used somewhere under the covers, is having issues managing >17,000 rows. That could be one of two things:

  1. You are out of heap space. With a 16MB non-compacting heap, and the fact that a Cursor holds the entire result set in the heap, that is not out of the question.
  2. CursorWindow only supports 1MB of data, which is what the error message suggests more directly.

If there is a logical way to divide your queries into discrete chunks, you could do incremental queries and use CursorJoiner to stitch them together, and see if that helps.

But, in all seriousness, 20,000+ rows in a 3.5″ screen, on a device that most closely resembles a 12-year-old PC in horsepower, is really asking a lot.

Leave a Comment