如何加载从sqlite的分贝超过1 MB的数据到Android光标?分贝、光标、加载、数据

2023-09-04 08:56:11 作者:安然

正是我努力不是从SQLite数据库到Android光标1MB的数据加载更多。在装载时它给下面的错误,如

exactly i am trying to load more than 1MB of data from sqlite database to android cursor. At the time of loading it gives following error like

08-04 11:10:15.813: ERROR/CursorWindow(4465): need to grow: mSize = 2097152, size = 403719, freeSpace() = 209669, numRows = 1
08-04 11:10:15.813: ERROR/CursorWindow(4465): Attempting to grow window beyond max size (2097152)
08-04 11:10:15.813: ERROR/Cursor(4465): Failed allocating 403719 bytes for blob at 0,13
08-04 11:10:15.813: DEBUG/Cursor(4465): finish_program_and_get_row_count row 0
08-04 11:10:15.899: ERROR/CursorWindow(4465): need to grow: mSize = 2097152, size = 403719, freeSpace() = 209669, numRows = 1
08-04 11:10:15.899: ERROR/CursorWindow(4465): Attempting to grow window beyond max size (2097152)
08-04 11:10:15.899: ERROR/Cursor(4465): Failed allocating 403719 bytes for blob at 0,13
08-04 11:10:15.899: DEBUG/Cursor(4465): finish_program_and_get_row_count row 0
08-04 11:10:15.899: ERROR/CursorWindow(4465): Bad request for field slot 0,0. numRows = 0, numColumns = 14
08-04 11:10:15.899: DEBUG/AndroidRuntime(4465): Shutting down VM.

如果任何人知道如何加载大量数据(超过1MB)到Android光标? 谢谢,

if any one knows how to load large data (more than 1MB) to android cursor? thanks,

推荐答案

不要存储500KB的斑点在你的数据库。在数据库中存储的标识符,并把斑点的文件到存储。如果你使用MODE_PRIVATE,他们不会被其它进程访问。

Don't store blobs of 500KB in your database. Store identifiers in your database and put the blobs as files onto the storage. If you use MODE_PRIVATE, they will not be accessible by other processes.