At the lowest level, content providers use CursorWindows, which are based on shared memory (ashmem).
Looking at the AOSP source file frameworks/base/libs/androidfw/CursorWindow.cpp
, the lowest level C++ code does not seem to impose any restrictions on the shared memory size, other than those inherited from the system-level ashmem and mmap services.
The next code layer, frameworks/base/core/jni/android_database_CursorWindow.cpp
, doesn't seem to impose any limits to the cursor window size either.
The Java code, frameworks/base/core/java/android/database/CursorWindow.java
, reads the buffer size from the Android frameworks internal configuration value config_cursorWindowSize
, which at least in KitKat seems to be 2048 by default. Hence, in KitKat the maximum CursorWindow size is 2 Mb if you use the normal Java interfaces. However, if you use the androidfw/CursorWindow.h
directly from C++, using the AOSP headers, then you can use larger CursorWindows. (Note that just using the NDK is not enough, since the CursorWindow is not part of the NDK API.)