New features in LibreOffice for Android document browser

The Document Foundation recently assigned one of the packages of the Android tender to Igalia; in particular, the one about cloud storage and email sharing. Our proposal comprised the following tasks:

  • Integrate the “share” feature of the Android framework to be able to send documents by email, bluetooth or any other means provided by the system.
  • Provide the means for the community to develop integration of cloud storage solutions.
  • Implement ownCloud integration as an example of how to integrate other cloud solutions.
  • Extensive documentation of the process to integrate more cloud solutions.

The work is completed and the patches available in the repository; most of them are already merged in master, while ownCloud support lives in a different branch for now.

Sharing documents

The Android-provided share feature allows to send a document not only through email but through bluetooth or any available methods, depending on the software installed in your device.

We have made this feature available to users through a context menu in the document browser, which pops up after a long press on a document.

Context menu in Android document browser

Share from the Android document browser

Support for cloud storage solutions

This task consisted of creating an interface to develop integration of any cloud storage solution. The first step was abstracting the code that made direct access to the file system, so it could be replaced by the different implementations of storage services, which from now on will be denominated document providers.

Afterwards, we created two document providers for local storage: one to access the internal storage of the device and another one to conveniently access the Documents directory inside the storage. These two simple providers served as a test for the UI to switch between both; we used the Android drawer widget, which pops-up with a swipe gesture from the left of the screen.

Side drawer in Android document browser

All the operations in the Android document browser were being performed in the same thread. Besides being suboptimal, the development framework actually forbids running network code in the main thread of the application. The next step for us was isolating the code that might need networking access when interacting with a cloud provider, and run it in separate threads.

ownCloud document provider

At that point, we had everything in place to write the code to access an ownCloud server. We did it with the help of an Android library provided by ownCloud developers.

There was still another task, though; any cloud service will likely need some configuration from the user for login credentials and so. We had to implement a preferences screen to enter these settings and do the proper wiring for the provider to be able to listen to any changes in them.

ownCloud settings screen

Documentation

To help other developers writing new document providers, we have tried to document the new code in detail, specially those interfaces that must be implemented to create new document providers. Besides, we will publish a document explaining how to extend the cloud storage integration here soon.

That’s all for now; to try the ownCloud provider you will have to build the feature/owncloud-provider-for-android branch yourself, while you will find the share feature in the packages already available in the Play Store or F-Droid. Hope you enjoy it!

3 thoughts on “New features in LibreOffice for Android document browser

  1. Thank you for describing your process.
    Though I am not a programmer, I find these ‘peaks trough the kitchen window’ of the making of an office suite fascinating.

    I can imagine some software school to use your tutorial as an assignment for the students to develop document provider plugins.

    If these Document provider plugins become popular, will they be added to the Desktop version too, or is the code not compatible?

    And Something that may be obvious when using it, but does not seem clear to me from the text: Is the ‘ Share’ option also directly available from the opened/edited document, or do you need to close and go to the document browser first?

    Again, thanks for the development and the blog

    MBB

    • Hello MBB,

      these document providers are not compatible with the desktop version; fortunately the latter has its own extension system and there are already extensions and core features that support most of the services out there 🙂

      The share option is not available from the open document; mind this is a beta and still needs a lot of work, specially the UI, IMO.

      Thanks for stopping by and sharing your thoughts!

  2. Pingback: Creating new document providers in LibreOffice for Android | Jacobo's home at Igalia

Leave a Reply

Your email address will not be published. Required fields are marked *