-2

How to fix it?

W/CursorWindow: Window is full: requested allocation 2108731 bytes, free space 17752 bytes, window size 2097152 bytes
W/CursorWindow: Window is full: requested allocation 2108731 bytes, free space 2096480 bytes, window size 2097152 bytes
E/CursorWindow: Failed to read row 0, column 0 from a CursorWindow which has 0 rows, 9 columns.
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • If you are storing big blobs, you might look into seeing if the android sqlite bindings provide an interface to the [incremental blob i/o API](https://www.sqlite.org/c3ref/blob_open.html) functions. – Shawn Mar 05 '19 at 16:10

1 Answers1

0

You are storing row data (typically one of the columns contains a media object (e.g. an image) as a blob) in the database that is too large to be handled by the Cursor. That is an attempt is being made to retrieve 2108731 bytes which is beyond the 2M (2097152 bytes) allocated to a Cursor Window.

You cannot use the android SDK's Cursor methods (without modification) to retrieve such a large amounts of data, even though you can store such an amount.

The fix is to store that data behind the blob (generally images) as a file and to then store a reference to the file (e.g. it's path or part thereof) in the database.

This link has examples (based on images) and a more comprehensive overview of the issue.

Alternately, this shows a way you could store such an image or images by splitting the data in parts.

MikeT
  • 51,415
  • 16
  • 49
  • 68