When a user downloads a personal finance app, they don't want to start with a blank screen.
They don't want to wait thirty days to see their first monthly spending report. They want instant gratification: they want the app to look back at their past financial alerts and reconstruct their spending history over the last three, six, or twelve months.
On Android, historical SMS messages live in the system's telephony database, accessible via content://sms/inbox .
However, accessing this data at scale is a classic engineering minefield:
An active user's device easily accumulates between 3,000 and 10,000 SMS messages over two years.
Querying all rows at once triggers CursorWindowAllocationException when the payload exceeds Android's 2 MB Binder transaction buffer.
Attempting to parse thousands of strings sequentially on the main thread causes the UI to freeze, leading to an immediate ANR (Application Not Responding) crash.
Here is how FinLedger architected a high-throughput, memory-bounded batch inbox…