Thanks to Smoose, we are now able to do some real progress with the Android version of LibreOffice. The idea is to first build a LibreOffice document viewer, which is able to display any type of document that is supported by LibreOffice. Afterwards build on that and provide more features and eventually editing. The application itself should be a Android native application and use LibreOffice (interfacing through LibreOfficeKit) to provide tiles of a rendered documents and other needed pieces.
In the last couple of weeks I have been working on making this plan a reality. The first goal is to prepare the base of the application so I used the Fennec (Firefox for Android) source code. Fennec already solves many of the problems that we would need to solve - especially concerning drawing of tiles, touch handling, scrolling, tools and removed the rest, that will not be needed or needed later in development.
The calls to Gecko (rendering engine in Firefox) were replaced with our own implementation either in Java or a facade to LibreOfficeKit. By using a mock document tiles (tiles of the document that are part of the application's assets) I was able to make the application work without actually interfacing with LibreOffice yet. With this the application looked something like this:
At this stage the application was able to show a mock document with working scrolling and touch handling. The next big step was integration of LibreOffice and writing a JNI facade to LibreOfficeKit so that a real document rendered by LibreOffice could be show on a screen. With a big help from kendy we managed to integrate LibreOffice and correctly initialize LibreOfficeKit. After that the a real LibreOffice rendered document appeared:
See application in action video here.
Finally some results! There are some issues at the tile borders but this will be eventually resolved. The application uses OpenGL ES 2 for rendering so the user experience is smooth for the most parts (there are still things to optimize). This is the current state of the application but it is still far from complete however a lot of quite difficult technical challenges have been resolved and true development and polishing can now start.
Next steps are cleaning up and refactor a lot of code, integrate useful parts of previous attempt (LibreOffice4Android), tune tile loading and invalidation (when to load or remove which tile), making parts asynchronous to reduce blocking and improve the user experience, text selection and copy/paste, ...
I am really excited with what we have achieved and really looking forward to see where we go from here. By the time of LibreOffice 4.4 we should have a working and polished document viewer application ready. Thanks again to Smoose for funding for the work on this important step!
Tomaž