Skip to content Skip to sidebar Skip to footer

Associating App With Epub Format

I'm at a loss for getting my application to register with epub files on a mobile device. I have a set of intent filters in my android manifest, but it still will not open with epub

Solution 1:

How do I get android system to recognize that epub files on internal or external storage can be opened with my app?

The "android system" does not have much to do with it, particularly today.

Support in MimeTypeMap (or, more accurately, libcore.net.MimeUtils from the framework classes) for .epub/application/epub+zip was added ~35 hours ago. Presumably, it will show up in a future edition of Android. Prior to that, the only file managers that will use that MIME type are ones that added it in themselves.

At a high level, when confronted with a problem like this, the solution is fairly simple:

  1. Find another app that does what you want (in this case, another EPUB reader)

  2. Use the App Browser app to see what that app's manifest looks like and what it chose for <intent-filter> stanzas

In general, I usually see an <intent-filter> with a scheme and a MIME type or a scheme, host, and path stuff. Having the MIME type and the path stuff is unlikely to help, as if the Intent does not explicitly have the MIME type in it, and Android doesn't know about mapping that specific extension to your MIME type, your <intent-filter> may not match.

Also, you will need to test with multiple "File Manager" apps, as Android does not have a file manager, and therefore you may be experiencing bugs/limitations in the one that you are testing.

How do I get the default file browser (Storage Access Framework) to show epub files?

Specify the proper MIME type and pray for a miracle.

Again, until Android itself offers a bit more built-in support for mapping .epub to the MIME type, you are reliant upon storage providers themselves happening to know that .epub maps to the application/epub+zip MIME type. Some providers will, because they are getting that information from some back-end server that may know more MIME types than does Android itself. Some providers may not, such as Android's MediaStore-backed provider of what's on external storage, as I doubt that MediaStore has its own local support for EPUB files.

Post a Comment for "Associating App With Epub Format"