← Back to team overview

ubuntu-phone team mailing list archive

Re: Ebook reader?

 

On Fri 17 May 2013 13:53:05 BST, Andrew Fullam wrote:
I was wondering if there is anyone currently working on an ebook
reader for ubuntu touch? I have an empty house all weekend so I was
looking to take a stab at it if no one has already undertaken the task?

I haven't worked on this, but I have thought about it quite a lot. :-)

It is somewhere in between impossible and very nearly impossible to write a book reader in pure QML for Ubuntu Touch right now, sadly. This is because there is no good way of dealing with binary data; QML's XMLHttpRequest object can't handle binary data, even when trying to use mimetype-overrides or similar. Equally, doing the work entirely inside a WebKit widget (using an existing JavaScript ePub library and reader, such as the very excellent http://monocle.inventivelabs.com.au/ (and https://github.com/joseph/Monocle) is problematic for similar reasons. To that end, the ebook reader will need a QML plugin, in C++, in order to actually unpack an epub in any sort of sane way. A second issue is: how does the book reader *get* some books? If I have an epub, how do I give it to the book reader? This stuff isn't wholly worked out yet; you may have seen a UDS session about content management for Ubuntu Touch, and that's very relevant here. (In particular, the book reader should not embed any kind of file manager.) So, there are some infrastructural challenges here. It's currently not possible for an Ubuntu Touch QML app to read a file even from its own storage space, although I imagine that that's coming as part of the SDK at some point.

Monocle can provide some useful tips, though; the C++ plugin which parses an epub could well export the same "spine" API as Monocle's ePub parser, which would be nice and consistent and probably help quite a bit in repurposing some of Monocle's JS to do most of the work, with the display layer being QML rather than HTML. That way, the amount of compiled C++ needed would be limited, and a lot of code would be shared with an existing project, which will help for development.

Brain dump over, anyway :-) I'm happy to chat further about this, though; when I get an Ubuntu phone, I'll need a book reader on it, because I use that app more than anything else!

sil



Follow ups

References