{"id":559,"date":"2015-03-05T16:46:56","date_gmt":"2015-03-05T15:46:56","guid":{"rendered":"http:\/\/blogs.igalia.com\/jaragunde\/?p=559"},"modified":"2015-03-05T16:46:56","modified_gmt":"2015-03-05T15:46:56","slug":"new-features-in-libreoffice-for-android-document-browser","status":"publish","type":"post","link":"https:\/\/blogs.igalia.com\/jaragunde\/2015\/03\/new-features-in-libreoffice-for-android-document-browser\/","title":{"rendered":"New features in LibreOffice for Android document browser"},"content":{"rendered":"<p>The Document Foundation <a href=\"http:\/\/blog.documentfoundation.org\/2015\/01\/27\/the-document-foundation-announces-the-results-of-the-android-tender\/\" title=\"The Document Foundation blog\">recently assigned<\/a> 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:<\/p>\n<ul>\n<li>Integrate the &#8220;share&#8221; feature of the Android framework to be able to send documents by email, bluetooth or any other means provided by the system.\n<\/li>\n<li>Provide the means for the community to develop integration of cloud storage solutions.\n<\/li>\n<li>Implement ownCloud integration as an example of how to integrate other cloud solutions.\n<\/li>\n<li>Extensive documentation of the process to integrate more cloud solutions.\n<\/li>\n<\/ul>\n<p>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 <a href=\"http:\/\/cgit.freedesktop.org\/libreoffice\/core\/log\/?h=feature\/owncloud-provider-for-android\" title=\"LibreOffice repository\">different branch<\/a> for now.<\/p>\n<h3>Sharing documents<\/h3>\n<p>The Android-provided <em>share<\/em> 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.<\/p>\n<p>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.<\/p>\n<p><a href=\"http:\/\/blogs.igalia.com\/jaragunde\/files\/2015\/03\/Screenshot_2015-01-29-11-21-38.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blogs.igalia.com\/jaragunde\/files\/2015\/03\/Screenshot_2015-01-29-11-21-38-300x198.png\" alt=\"Context menu in Android document browser\" width=\"300\" height=\"198\" class=\"aligncenter size-medium wp-image-560\" srcset=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2015\/03\/Screenshot_2015-01-29-11-21-38-300x198.png 300w, https:\/\/blogs.igalia.com\/jaragunde\/files\/2015\/03\/Screenshot_2015-01-29-11-21-38-452x300.png 452w, https:\/\/blogs.igalia.com\/jaragunde\/files\/2015\/03\/Screenshot_2015-01-29-11-21-38.png 768w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/blogs.igalia.com\/jaragunde\/files\/2015\/03\/Screenshot_2015-01-29-11-29-55.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blogs.igalia.com\/jaragunde\/files\/2015\/03\/Screenshot_2015-01-29-11-29-55-300x198.png\" alt=\"Share from the Android document browser\" width=\"300\" height=\"198\" class=\"aligncenter size-medium wp-image-561\" srcset=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2015\/03\/Screenshot_2015-01-29-11-29-55-300x198.png 300w, https:\/\/blogs.igalia.com\/jaragunde\/files\/2015\/03\/Screenshot_2015-01-29-11-29-55-452x300.png 452w, https:\/\/blogs.igalia.com\/jaragunde\/files\/2015\/03\/Screenshot_2015-01-29-11-29-55.png 768w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h3>Support for cloud storage solutions<\/h3>\n<p>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.<\/p>\n<p>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 <em>Documents<\/em> 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.<\/p>\n<p><a href=\"http:\/\/blogs.igalia.com\/jaragunde\/files\/2015\/03\/Screenshot.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blogs.igalia.com\/jaragunde\/files\/2015\/03\/Screenshot-300x198.png\" alt=\"Side drawer in Android document browser\" width=\"300\" height=\"198\" class=\"aligncenter size-medium wp-image-565\" srcset=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2015\/03\/Screenshot-300x198.png 300w, https:\/\/blogs.igalia.com\/jaragunde\/files\/2015\/03\/Screenshot-452x300.png 452w, https:\/\/blogs.igalia.com\/jaragunde\/files\/2015\/03\/Screenshot.png 768w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>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.<\/p>\n<h3>ownCloud document provider<\/h3>\n<p>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 <a href=\"https:\/\/github.com\/owncloud\/android-library\" title=\"ownCloud Android library\">Android library<\/a> provided by ownCloud developers.<\/p>\n<p>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.<\/p>\n<p><a href=\"http:\/\/blogs.igalia.com\/jaragunde\/files\/2015\/03\/Screenshot_2015-03-05-10-44-33.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blogs.igalia.com\/jaragunde\/files\/2015\/03\/Screenshot_2015-03-05-10-44-33-300x198.png\" alt=\"ownCloud settings screen\" width=\"300\" height=\"198\" class=\"aligncenter size-medium wp-image-564\" srcset=\"https:\/\/blogs.igalia.com\/jaragunde\/files\/2015\/03\/Screenshot_2015-03-05-10-44-33-300x198.png 300w, https:\/\/blogs.igalia.com\/jaragunde\/files\/2015\/03\/Screenshot_2015-03-05-10-44-33-452x300.png 452w, https:\/\/blogs.igalia.com\/jaragunde\/files\/2015\/03\/Screenshot_2015-03-05-10-44-33.png 768w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h3>Documentation<\/h3>\n<p>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.<\/p>\n<p>That&#8217;s all for now; to try the ownCloud provider you will have to build the <a href=\"http:\/\/cgit.freedesktop.org\/libreoffice\/core\/log\/?h=feature\/owncloud-provider-for-android\" title=\"LibreOffice repository\">feature\/owncloud-provider-for-android branch<\/a> yourself, while you will find the share feature in the packages already available in the <a href=\"https:\/\/play.google.com\/store\/apps\/details?id=com.collabora.libreoffice\" title=\"Google Play Store\">Play Store<\/a> or <a href=\"https:\/\/f-droid.org\/repository\/browse\/?fdid=com.collabora.libreoffice\" title=\"F-Droid repository\">F-Droid<\/a>. Hope you enjoy it!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8220;share&#8221; feature of the Android framework to &hellip; <a href=\"https:\/\/blogs.igalia.com\/jaragunde\/2015\/03\/new-features-in-libreoffice-for-android-document-browser\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,3,17],"tags":[],"class_list":["post-559","post","type-post","status-publish","format-standard","hentry","category-android","category-igalia","category-libreoffice"],"_links":{"self":[{"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/posts\/559","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/comments?post=559"}],"version-history":[{"count":5,"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/posts\/559\/revisions"}],"predecessor-version":[{"id":568,"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/posts\/559\/revisions\/568"}],"wp:attachment":[{"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/media?parent=559"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/categories?post=559"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/tags?post=559"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}