Skip to content

Finding Files In Android

Isaac Hutt edited this page Mar 7, 2021 · 1 revision

In order for users to be able to open a ZIM file though a file browser/web browser/email client etc the app needs to know we accept files of the type needed to open. The issue is ZIM files don't have a mime type beyond application/octet-stream

Because of this the support for broadcasting our acceptance of ZIM files seems to be majorly fragmented and app specific. We have had a hacky approach for a while https://github.com/kiwix/kiwix-android/blob/develop/app/src/main/AndroidManifest.xml#L37 but in lots of places this doesn't catch the files.

I have tried various other things over the years but nothing has worked for every use case.

On the other side of the coin we can never be certain we are scanning the whole file system when the app looks for ZIM files so we can miss files due to the directories Android chooses to expose to us (and each manufacture having slightly different sd card mount points etc). Years ago, I (@mhutti1) implemented a solution to allow the user to load files from a custom location in app but we deprecated this feature at some point over the last year or so and so there is not currently a working workaround either.