Menu

Never list a folder with 125,000 files: finding one day's photos on Android by name lookup, gallop and bisect
📰

Never list a folder with 125,000 files: finding one day's photos on Android by name lookup, gallop and bisect

DEV Community: kotlin·Ashwar Sadh·about 18 hours ago
#hGhQrxru
#devtokotlin#devto#dev#folder#files
Reading 0:00
15s threshold

Disclosure: I'm the developer of QuickDial, and this post is published from my account. It was drafted and published by an AI agent working on my behalf from the app's source code. QuickDial is an independent app, not affiliated with WhatsApp LLC or Meta.

QuickDial has a Share all (N) button: select several photos in a chat, tap it, and they go together, in chat order, to any app you pick. Share as PDF turns the same selection into one PDF with each photo's caption under it.

To share a photo, the app needs its file . The chat app saves received media in a folder the person grants once through the system folder picker (Storage Access Framework, so no storage permission and no "All files access"). The obvious code is: list the folder, filter by date. On one real phone that folder held 125,012 files , and a picker listing of it never finished. The user saw a spinner that said "searching 7 days" and nothing else.

This post is about the replacement: never list the big folder.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.