Android Cursor maximum size Android Cursor maximum size database database

Android Cursor maximum size


I don't think there's a hard and fast way to determine the right limit, but I looked in the CursorWindow documentation and found that copyStringToBuffer (int row, int column, CharArrayBuffer buffer) seems promising as CharArrayBuffer has a integer field called sizeCopied and the method copyStringToBuffer takes the text at the specified row and column. Maybe you can get the size from the buffer and add for each row and column you have? If you're using SQLiteCursor, you can use setWindow(CursorWindow window) to set your own window.


You can put LIMIT clause, so that rows are fetched in parts.