[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.0' - 47 commits - android/Bootstrap android/CustomTarget_android_desktop.mk android/CustomTarget_lo_android.mk android/experimental android/.gitignore android/Makefile android/README android/source configure.ac desktop/source download.lst external/Module_external.mk external/owncloud-android-lib .gitignore include/osl libreofficekit/source Makefile.fetch Makefile.in README.cross RepositoryExternal.mk sal/android sal/osl solenv/bin vcl/android vcl/inc

Christian Lohmaier lohmaier+LibreOffice at googlemail.com
Thu Oct 15 02:21:18 PDT 2015


 .gitignore                                                                                                  |    1 
 Makefile.fetch                                                                                              |    1 
 Makefile.in                                                                                                 |    3 
 README.cross                                                                                                |   16 
 RepositoryExternal.mk                                                                                       |   16 
 android/.gitignore                                                                                          |   24 
 android/Bootstrap/.gitignore                                                                                |    1 
 android/Bootstrap/AndroidManifest.xml                                                                       |    9 
 android/Bootstrap/Makefile.shared                                                                           |  196 -
 android/Bootstrap/ant.properties                                                                            |   17 
 android/Bootstrap/build.xml                                                                                 |   85 
 android/Bootstrap/no-resource-compress-20.xml                                                               |   45 
 android/Bootstrap/no-resource-compress-21.xml                                                               |   46 
 android/Bootstrap/no-resource-compress-22.xml                                                               |   46 
 android/Bootstrap/no-resource-compress-23.xml                                                               |   46 
 android/Bootstrap/no-resource-compress-24.xml                                                               |   46 
 android/Bootstrap/project.properties                                                                        |   12 
 android/Bootstrap/src/org/libreoffice/android/AppSupport.java                                               |   31 
 android/Bootstrap/src/org/libreoffice/android/Bootstrap.java                                                |  105 
 android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java                                               |   51 
 android/CustomTarget_android_desktop.mk                                                                     |   36 
 android/CustomTarget_lo_android.mk                                                                          |    8 
 android/Makefile                                                                                            |    6 
 android/README                                                                                              |   63 
 android/experimental/.gitignore                                                                             |    2 
 android/experimental/DocumentLoader/AndroidManifest.xml                                                     |   23 
 android/experimental/DocumentLoader/Makefile                                                                |   37 
 android/experimental/DocumentLoader/build.xml                                                               |   84 
 android/experimental/DocumentLoader/fonts.conf                                                              |  154 -
 android/experimental/DocumentLoader/jni/Android.mk                                                          |    8 
 android/experimental/DocumentLoader/project.properties                                                      |   14 
 android/experimental/DocumentLoader/res/menu/option.xml                                                     |    5 
 android/experimental/DocumentLoader/res/values/strings.xml                                                  |    4 
 android/experimental/DocumentLoader/src/com/polites/android/Animation.java                                  |   28 
 android/experimental/DocumentLoader/src/com/polites/android/Animator.java                                   |   91 
 android/experimental/DocumentLoader/src/com/polites/android/FlingAnimation.java                             |   70 
 android/experimental/DocumentLoader/src/com/polites/android/FlingAnimationListener.java                     |   24 
 android/experimental/DocumentLoader/src/com/polites/android/GestureImageView.java                           |  718 ------
 android/experimental/DocumentLoader/src/com/polites/android/GestureImageViewListener.java                   |   26 
 android/experimental/DocumentLoader/src/com/polites/android/GestureImageViewTouchListener.java              |  565 ----
 android/experimental/DocumentLoader/src/com/polites/android/MathUtils.java                                  |   76 
 android/experimental/DocumentLoader/src/com/polites/android/MoveAnimation.java                              |  102 
 android/experimental/DocumentLoader/src/com/polites/android/MoveAnimationListener.java                      |   22 
 android/experimental/DocumentLoader/src/com/polites/android/VectorF.java                                    |   63 
 android/experimental/DocumentLoader/src/com/polites/android/ZoomAnimation.java                              |  162 -
 android/experimental/DocumentLoader/src/com/polites/android/ZoomAnimationListener.java                      |   21 
 android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java                | 1140 ----------
 android/experimental/LOAndroid3/AndroidManifest.xml.in                                                      |  112 
 android/experimental/LOAndroid3/Makefile                                                                    |   42 
 android/experimental/LOAndroid3/build.xml                                                                   |   84 
 android/experimental/LOAndroid3/fonts.conf                                                                  |  154 -
 android/experimental/LOAndroid3/jni/Android.mk                                                              |    8 
 android/experimental/LOAndroid3/proguard-project.txt                                                        |   20 
 android/experimental/LOAndroid3/project.properties                                                          |   15 
 android/experimental/LOAndroid3/res/drawable/bg_striped.xml                                                 |    6 
 android/experimental/LOAndroid3/res/drawable/bg_striped_split.xml                                           |    6 
 android/experimental/LOAndroid3/res/drawable/black_white_gradient.xml                                       |   15 
 android/experimental/LOAndroid3/res/drawable/handle_end_level.xml                                           |   14 
 android/experimental/LOAndroid3/res/drawable/handle_start_level.xml                                         |   14 
 android/experimental/LOAndroid3/res/layout/about.xml                                                        |   47 
 android/experimental/LOAndroid3/res/layout/activity_document_browser.xml                                    |   36 
 android/experimental/LOAndroid3/res/layout/activity_main.xml                                                |   65 
 android/experimental/LOAndroid3/res/layout/document_part_list_layout.xml                                    |   20 
 android/experimental/LOAndroid3/res/layout/document_viewer.xml                                              |   33 
 android/experimental/LOAndroid3/res/layout/file_explorer_grid_item.xml                                      |   37 
 android/experimental/LOAndroid3/res/layout/file_grid.xml                                                    |   25 
 android/experimental/LOAndroid3/res/layout/file_list.xml                                                    |   20 
 android/experimental/LOAndroid3/res/layout/file_list_item.xml                                               |   41 
 android/experimental/LOAndroid3/res/layout/item_in_drawer.xml                                               |   17 
 android/experimental/LOAndroid3/res/layout/main.xml                                                         |   22 
 android/experimental/LOAndroid3/res/layout/navigation_grid_item.xml                                         |   23 
 android/experimental/LOAndroid3/res/layout/text_selection_handles.xml                                       |   14 
 android/experimental/LOAndroid3/res/layout/toolbar.xml                                                      |   10 
 android/experimental/LOAndroid3/res/menu/context_menu.xml                                                   |    7 
 android/experimental/LOAndroid3/res/menu/main.xml                                                           |   54 
 android/experimental/LOAndroid3/res/menu/view_menu.xml                                                      |   19 
 android/experimental/LOAndroid3/res/values-v21/themes.xml                                                   |   18 
 android/experimental/LOAndroid3/res/values/arrays.xml                                                       |   59 
 android/experimental/LOAndroid3/res/values/attrs.xml                                                        |   17 
 android/experimental/LOAndroid3/res/values/colors.xml                                                       |   95 
 android/experimental/LOAndroid3/res/values/dimens.xml                                                       |    8 
 android/experimental/LOAndroid3/res/values/ids.xml                                                          |    4 
 android/experimental/LOAndroid3/res/values/strings.xml                                                      |   59 
 android/experimental/LOAndroid3/res/values/themes.xml                                                       |   17 
 android/experimental/LOAndroid3/res/xml/libreoffice_preferences.xml                                         |   32 
 android/experimental/LOAndroid3/src/java/org/libreoffice/DocumentPartView.java                              |   21 
 android/experimental/LOAndroid3/src/java/org/libreoffice/DocumentPartViewListAdapter.java                   |   51 
 android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java                           |  456 ----
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOAbout.java                                       |  113 
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOEvent.java                                       |  118 -
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitInputConnectionHandler.java                   |   75 
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java                                    |  176 -
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java                                   |  343 ---
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java                             |  510 ----
 android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java                       |  393 ---
 android/experimental/LOAndroid3/src/java/org/libreoffice/MockTileProvider.java                              |  159 -
 android/experimental/LOAndroid3/src/java/org/libreoffice/SettingsActivity.java                              |   37 
 android/experimental/LOAndroid3/src/java/org/libreoffice/ThumbnailCreator.java                              |  121 -
 android/experimental/LOAndroid3/src/java/org/libreoffice/TileIdentifier.java                                |   92 
 android/experimental/LOAndroid3/src/java/org/libreoffice/TileProvider.java                                  |  149 -
 android/experimental/LOAndroid3/src/java/org/libreoffice/TileProviderFactory.java                           |   43 
 android/experimental/LOAndroid3/src/java/org/libreoffice/ToolbarController.java                             |  139 -
 android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/BitmapHandle.java                           |   61 
 android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/CanvasElement.java                          |   45 
 android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/CanvasElementImplRequirement.java           |   25 
 android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/CommonCanvasElement.java                    |   49 
 android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/Cursor.java                                 |   56 
 android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java                       |  292 --
 android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java                 |  146 -
 android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/ImageUtils.java                             |   24 
 android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/SelectionHandle.java                        |   69 
 android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/SelectionHandleEnd.java                     |   23 
 android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/SelectionHandleMiddle.java                  |   35 
 android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/SelectionHandleStart.java                   |   35 
 android/experimental/LOAndroid3/src/java/org/libreoffice/overlay/DocumentOverlay.java                       |  210 -
 android/experimental/LOAndroid3/src/java/org/libreoffice/overlay/DocumentOverlayView.java                   |  389 ---
 android/experimental/LOAndroid3/src/java/org/libreoffice/storage/DocumentProviderFactory.java               |  100 
 android/experimental/LOAndroid3/src/java/org/libreoffice/storage/IDocumentProvider.java                     |   46 
 android/experimental/LOAndroid3/src/java/org/libreoffice/storage/IFile.java                                 |  105 
 android/experimental/LOAndroid3/src/java/org/libreoffice/storage/local/LocalDocumentsDirectoryProvider.java |   39 
 android/experimental/LOAndroid3/src/java/org/libreoffice/storage/local/LocalDocumentsProvider.java          |   40 
 android/experimental/LOAndroid3/src/java/org/libreoffice/storage/local/LocalFile.java                       |   96 
 android/experimental/LOAndroid3/src/java/org/libreoffice/ui/FileUtilities.java                              |  283 --
 android/experimental/LOAndroid3/src/java/org/libreoffice/ui/FolderIconView.java                             |  211 -
 android/experimental/LOAndroid3/src/java/org/libreoffice/ui/GridItemAdapter.java                            |  131 -
 android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java                      |  754 ------
 android/experimental/LOAndroid3/src/java/org/libreoffice/ui/PageView.java                                   |   69 
 android/experimental/LOAndroid3/src/java/org/libreoffice/ui/WriterViewerActivity.java                       |   50 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/OnInterceptTouchListener.java                    |   14 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/OnSlideSwipeListener.java                        |   94 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/ZoomConstraints.java                             |   42 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/Axis.java                                    |  337 --
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/BufferedCairoImage.java                      |   83 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/CairoGLInfo.java                             |   35 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/CairoImage.java                              |   28 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/CairoUtils.java                              |   51 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java                       |  287 --
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/DisplayPortCalculator.java                   |  751 ------
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/DisplayPortMetrics.java                      |   67 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/DynamicTileLayer.java                        |   30 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/FixedZoomTileLayer.java                      |   31 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/FloatSize.java                               |   53 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GLController.java                            |  275 --
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java                        |  359 ---
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ImmutableViewportMetrics.java                |  237 --
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/InputConnectionHandler.java                  |   15 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/IntSize.java                                 |   73 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java                   | 1066 ---------
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/Layer.java                                   |  218 -
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerRenderer.java                           |  520 ----
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerView.java                               |  458 ----
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/NinePatchTileLayer.java                      |  131 -
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/PanZoomController.java                       |   40 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/PanZoomTarget.java                           |   26 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/PointUtils.java                              |   51 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/RectUtils.java                               |  111 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/RenderControllerThread.java                  |  148 -
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ScrollbarLayer.java                          |  453 ---
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/SimpleScaleGestureDetector.java              |  322 --
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/SingleTileLayer.java                         |  154 -
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/SubTile.java                                 |  256 --
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/SubdocumentScrollHelper.java                 |   78 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/TextLayer.java                               |   69 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/TextureGenerator.java                        |   77 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/TextureReaper.java                           |   53 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/TileLayer.java                               |  176 -
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/TouchEventHandler.java                       |  306 --
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ViewportMetrics.java                         |  173 -
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/util/FloatUtils.java                             |   41 
 android/experimental/desktop/AndroidManifest.xml                                                            |   21 
 android/experimental/desktop/Makefile                                                                       |   68 
 android/experimental/desktop/ant.properties                                                                 |   17 
 android/experimental/desktop/build.xml                                                                      |   84 
 android/experimental/desktop/fonts.conf                                                                     |  154 -
 android/experimental/desktop/jni/Android.mk                                                                 |   19 
 android/experimental/desktop/project.properties                                                             |   13 
 android/experimental/desktop/res/layout/main.xml                                                            |   12 
 android/experimental/desktop/res/values/strings.xml                                                         |    4 
 android/experimental/desktop/src/org/libreoffice/experimental/desktop/Desktop.java                          |  379 ---
 android/source/AndroidManifest.xml                                                                          |  119 +
 android/source/Makefile                                                                                     |   38 
 android/source/ReleaseManifest.xml                                                                          |    7 
 android/source/build.gradle                                                                                 |  289 ++
 android/source/fonts.conf                                                                                   |  154 +
 android/source/gradle/wrapper/gradle-wrapper.jar                                                            |binary
 android/source/gradle/wrapper/gradle-wrapper.properties                                                     |    6 
 android/source/gradlew                                                                                      |  164 +
 android/source/gradlew.bat                                                                                  |   90 
 android/source/jni/Android.mk                                                                               |    8 
 android/source/proguard-project.txt                                                                         |   20 
 android/source/res/drawable-hdpi/action_bold.png                                                            |binary
 android/source/res/drawable-hdpi/action_italic.png                                                          |binary
 android/source/res/drawable-hdpi/action_search.png                                                          |binary
 android/source/res/drawable-hdpi/action_search_light.png                                                    |binary
 android/source/res/drawable-hdpi/action_strikeout.png                                                       |binary
 android/source/res/drawable-hdpi/action_underline.png                                                       |binary
 android/source/res/drawable-hdpi/handle_end.png                                                             |binary
 android/source/res/drawable-hdpi/handle_middle.png                                                          |binary
 android/source/res/drawable-hdpi/handle_start.png                                                           |binary
 android/source/res/drawable-hdpi/light_view_as_grid.png                                                     |binary
 android/source/res/drawable-hdpi/light_view_as_list.png                                                     |binary
 android/source/res/drawable-hdpi/lo_icon.png                                                                |binary
 android/source/res/drawable-hdpi/main.png                                                                   |binary
 android/source/res/drawable-ldpi/lo_icon.png                                                                |binary
 android/source/res/drawable-mdpi/action_bold.png                                                            |binary
 android/source/res/drawable-mdpi/action_italic.png                                                          |binary
 android/source/res/drawable-mdpi/action_strikeout.png                                                       |binary
 android/source/res/drawable-mdpi/action_underline.png                                                       |binary
 android/source/res/drawable-mdpi/background.png                                                             |binary
 android/source/res/drawable-mdpi/lo_icon.png                                                                |binary
 android/source/res/drawable-mdpi/shadow.png                                                                 |binary
 android/source/res/drawable-xhdpi/action_bold.png                                                           |binary
 android/source/res/drawable-xhdpi/action_italic.png                                                         |binary
 android/source/res/drawable-xhdpi/action_strikeout.png                                                      |binary
 android/source/res/drawable-xhdpi/action_underline.png                                                      |binary
 android/source/res/drawable-xhdpi/handle_end.png                                                            |binary
 android/source/res/drawable-xhdpi/handle_middle.png                                                         |binary
 android/source/res/drawable-xhdpi/handle_start.png                                                          |binary
 android/source/res/drawable-xxxhdpi/action_bold.png                                                         |binary
 android/source/res/drawable-xxxhdpi/action_italic.png                                                       |binary
 android/source/res/drawable-xxxhdpi/action_strikeout.png                                                    |binary
 android/source/res/drawable-xxxhdpi/action_underline.png                                                    |binary
 android/source/res/drawable-xxxhdpi/ic_check_grey600_24dp.png                                               |binary
 android/source/res/drawable-xxxhdpi/ic_format_keyboard_grey600_24dp.png                                     |binary
 android/source/res/drawable-xxxhdpi/ic_menu_grey600_24dp.png                                                |binary
 android/source/res/drawable/calc.png                                                                        |binary
 android/source/res/drawable/draw.png                                                                        |binary
 android/source/res/drawable/dummy_page.png                                                                  |binary
 android/source/res/drawable/folder.png                                                                      |binary
 android/source/res/drawable/handle_end.png                                                                  |binary
 android/source/res/drawable/handle_end_level.xml                                                            |   14 
 android/source/res/drawable/handle_graphic.png                                                              |binary
 android/source/res/drawable/handle_middle.png                                                               |binary
 android/source/res/drawable/handle_start.png                                                                |binary
 android/source/res/drawable/handle_start_level.xml                                                          |   14 
 android/source/res/drawable/impress.png                                                                     |binary
 android/source/res/drawable/writer.png                                                                      |binary
 android/source/res/layout/about.xml                                                                         |   49 
 android/source/res/layout/activity_document_browser.xml                                                     |   43 
 android/source/res/layout/activity_main.xml                                                                 |   65 
 android/source/res/layout/document_part_list_layout.xml                                                     |   22 
 android/source/res/layout/document_viewer.xml                                                               |   33 
 android/source/res/layout/file_explorer_grid_item.xml                                                       |   40 
 android/source/res/layout/file_grid.xml                                                                     |   25 
 android/source/res/layout/file_list.xml                                                                     |   20 
 android/source/res/layout/file_list_item.xml                                                                |   47 
 android/source/res/layout/item_in_drawer.xml                                                                |   17 
 android/source/res/layout/main.xml                                                                          |   22 
 android/source/res/layout/text_selection_handles.xml                                                        |   14 
 android/source/res/layout/toolbar.xml                                                                       |   10 
 android/source/res/menu/context_menu.xml                                                                    |    7 
 android/source/res/menu/main.xml                                                                            |   55 
 android/source/res/menu/view_menu.xml                                                                       |   21 
 android/source/res/values/arrays.xml                                                                        |   59 
 android/source/res/values/attrs.xml                                                                         |   17 
 android/source/res/values/colors.xml                                                                        |   95 
 android/source/res/values/dimens.xml                                                                        |    8 
 android/source/res/values/ids.xml                                                                           |    4 
 android/source/res/values/strings.xml                                                                       |   81 
 android/source/res/values/themes.xml                                                                        |   17 
 android/source/res/xml/documentprovider_preferences.xml                                                     |   26 
 android/source/res/xml/libreoffice_preferences.xml                                                          |   32 
 android/source/src/java/org/libreoffice/DocumentPartView.java                                               |   21 
 android/source/src/java/org/libreoffice/DocumentPartViewListAdapter.java                                    |   51 
 android/source/src/java/org/libreoffice/InvalidationHandler.java                                            |  457 ++++
 android/source/src/java/org/libreoffice/LOAbout.java                                                        |  113 
 android/source/src/java/org/libreoffice/LOEvent.java                                                        |  118 +
 android/source/src/java/org/libreoffice/LOKitInputConnectionHandler.java                                    |   75 
 android/source/src/java/org/libreoffice/LOKitShell.java                                                     |  176 +
 android/source/src/java/org/libreoffice/LOKitThread.java                                                    |  343 +++
 android/source/src/java/org/libreoffice/LOKitTileProvider.java                                              |  510 ++++
 android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java                                        |  549 ++++
 android/source/src/java/org/libreoffice/MockTileProvider.java                                               |  157 +
 android/source/src/java/org/libreoffice/SettingsActivity.java                                               |   37 
 android/source/src/java/org/libreoffice/ThumbnailCreator.java                                               |  121 +
 android/source/src/java/org/libreoffice/TileIdentifier.java                                                 |   92 
 android/source/src/java/org/libreoffice/TileProvider.java                                                   |  148 +
 android/source/src/java/org/libreoffice/TileProviderFactory.java                                            |   43 
 android/source/src/java/org/libreoffice/ToolbarController.java                                              |  139 +
 android/source/src/java/org/libreoffice/canvas/BitmapHandle.java                                            |   61 
 android/source/src/java/org/libreoffice/canvas/CanvasElement.java                                           |   45 
 android/source/src/java/org/libreoffice/canvas/CanvasElementImplRequirement.java                            |   25 
 android/source/src/java/org/libreoffice/canvas/CommonCanvasElement.java                                     |   49 
 android/source/src/java/org/libreoffice/canvas/Cursor.java                                                  |   56 
 android/source/src/java/org/libreoffice/canvas/GraphicSelection.java                                        |  292 ++
 android/source/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java                                  |  146 +
 android/source/src/java/org/libreoffice/canvas/ImageUtils.java                                              |   24 
 android/source/src/java/org/libreoffice/canvas/SelectionHandle.java                                         |   69 
 android/source/src/java/org/libreoffice/canvas/SelectionHandleEnd.java                                      |   22 
 android/source/src/java/org/libreoffice/canvas/SelectionHandleMiddle.java                                   |   34 
 android/source/src/java/org/libreoffice/canvas/SelectionHandleStart.java                                    |   34 
 android/source/src/java/org/libreoffice/overlay/DocumentOverlay.java                                        |  210 +
 android/source/src/java/org/libreoffice/overlay/DocumentOverlayView.java                                    |  389 +++
 android/source/src/java/org/libreoffice/storage/DocumentProviderFactory.java                                |  121 +
 android/source/src/java/org/libreoffice/storage/DocumentProviderSettingsActivity.java                       |   69 
 android/source/src/java/org/libreoffice/storage/IDocumentProvider.java                                      |   57 
 android/source/src/java/org/libreoffice/storage/IFile.java                                                  |  113 
 android/source/src/java/org/libreoffice/storage/local/LocalDocumentsDirectoryProvider.java                  |   44 
 android/source/src/java/org/libreoffice/storage/local/LocalDocumentsProvider.java                           |   51 
 android/source/src/java/org/libreoffice/storage/local/LocalFile.java                                        |  101 
 android/source/src/java/org/libreoffice/storage/owncloud/OwnCloudFile.java                                  |  142 +
 android/source/src/java/org/libreoffice/storage/owncloud/OwnCloudProvider.java                              |  180 +
 android/source/src/java/org/libreoffice/ui/FileUtilities.java                                               |  281 ++
 android/source/src/java/org/libreoffice/ui/FolderIconView.java                                              |  207 +
 android/source/src/java/org/libreoffice/ui/GridItemAdapter.java                                             |  121 +
 android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java                                       |  838 +++++++
 android/source/src/java/org/libreoffice/ui/PageView.java                                                    |   69 
 android/source/src/java/org/mozilla/gecko/OnInterceptTouchListener.java                                     |   14 
 android/source/src/java/org/mozilla/gecko/OnSlideSwipeListener.java                                         |   94 
 android/source/src/java/org/mozilla/gecko/ZoomConstraints.java                                              |   42 
 android/source/src/java/org/mozilla/gecko/gfx/Axis.java                                                     |  337 ++
 android/source/src/java/org/mozilla/gecko/gfx/BufferedCairoImage.java                                       |   83 
 android/source/src/java/org/mozilla/gecko/gfx/CairoGLInfo.java                                              |   35 
 android/source/src/java/org/mozilla/gecko/gfx/CairoImage.java                                               |   28 
 android/source/src/java/org/mozilla/gecko/gfx/CairoUtils.java                                               |   51 
 android/source/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java                                        |  287 ++
 android/source/src/java/org/mozilla/gecko/gfx/DisplayPortCalculator.java                                    |  750 ++++++
 android/source/src/java/org/mozilla/gecko/gfx/DisplayPortMetrics.java                                       |   67 
 android/source/src/java/org/mozilla/gecko/gfx/DynamicTileLayer.java                                         |   30 
 android/source/src/java/org/mozilla/gecko/gfx/FixedZoomTileLayer.java                                       |   31 
 android/source/src/java/org/mozilla/gecko/gfx/FloatSize.java                                                |   53 
 android/source/src/java/org/mozilla/gecko/gfx/GLController.java                                             |  275 ++
 android/source/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java                                         |  359 +++
 android/source/src/java/org/mozilla/gecko/gfx/ImmutableViewportMetrics.java                                 |  237 ++
 android/source/src/java/org/mozilla/gecko/gfx/InputConnectionHandler.java                                   |   15 
 android/source/src/java/org/mozilla/gecko/gfx/IntSize.java                                                  |   73 
 android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java                                    | 1065 +++++++++
 android/source/src/java/org/mozilla/gecko/gfx/Layer.java                                                    |  218 +
 android/source/src/java/org/mozilla/gecko/gfx/LayerRenderer.java                                            |  520 ++++
 android/source/src/java/org/mozilla/gecko/gfx/LayerView.java                                                |  458 ++++
 android/source/src/java/org/mozilla/gecko/gfx/NinePatchTileLayer.java                                       |  131 +
 android/source/src/java/org/mozilla/gecko/gfx/PanZoomController.java                                        |   40 
 android/source/src/java/org/mozilla/gecko/gfx/PanZoomTarget.java                                            |   26 
 android/source/src/java/org/mozilla/gecko/gfx/PointUtils.java                                               |   51 
 android/source/src/java/org/mozilla/gecko/gfx/RectUtils.java                                                |  111 
 android/source/src/java/org/mozilla/gecko/gfx/RenderControllerThread.java                                   |  148 +
 android/source/src/java/org/mozilla/gecko/gfx/ScrollbarLayer.java                                           |  451 +++
 android/source/src/java/org/mozilla/gecko/gfx/SimpleScaleGestureDetector.java                               |  322 ++
 android/source/src/java/org/mozilla/gecko/gfx/SingleTileLayer.java                                          |  154 +
 android/source/src/java/org/mozilla/gecko/gfx/SubTile.java                                                  |  256 ++
 android/source/src/java/org/mozilla/gecko/gfx/SubdocumentScrollHelper.java                                  |   78 
 android/source/src/java/org/mozilla/gecko/gfx/TextLayer.java                                                |   69 
 android/source/src/java/org/mozilla/gecko/gfx/TextureGenerator.java                                         |   77 
 android/source/src/java/org/mozilla/gecko/gfx/TextureReaper.java                                            |   53 
 android/source/src/java/org/mozilla/gecko/gfx/TileLayer.java                                                |  176 +
 android/source/src/java/org/mozilla/gecko/gfx/TouchEventHandler.java                                        |  306 ++
 android/source/src/java/org/mozilla/gecko/gfx/ViewportMetrics.java                                          |  173 +
 android/source/src/java/org/mozilla/gecko/util/FloatUtils.java                                              |   41 
 configure.ac                                                                                                |   11 
 desktop/source/app/sofficemain.cxx                                                                          |   15 
 dev/null                                                                                                    |binary
 download.lst                                                                                                |    2 
 external/Module_external.mk                                                                                 |    1 
 external/owncloud-android-lib/ExternalProject_owncloud_android_lib.mk                                       |   25 
 external/owncloud-android-lib/Makefile                                                                      |    7 
 external/owncloud-android-lib/Module_owncloud-android-lib.mk                                                |   17 
 external/owncloud-android-lib/README                                                                        |    7 
 external/owncloud-android-lib/UnpackedTarball_owncloud_android_lib.mk                                       |   14 
 include/osl/detail/android-bootstrap.h                                                                      |    5 
 libreofficekit/source/gtk/lokdocview.cxx                                                                    |    2 
 sal/android/libreofficekit-jni.c                                                                            |   19 
 sal/android/lo-bootstrap.c                                                                                  |  182 -
 sal/osl/unx/file.cxx                                                                                        |   29 
 solenv/bin/native-code.py                                                                                   |   18 
 vcl/android/androidinst.cxx                                                                                 |  269 --
 vcl/inc/android/androidinst.hxx                                                                             |    3 
 366 files changed, 16823 insertions(+), 20917 deletions(-)

New commits:
commit 66108eba5725aed2b1aa3c85e1fbd3eccb856ae1
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Sun Oct 11 18:12:16 2015 +0200

    tdf#90053 add svgio to Android Viewer, so display of svg works
    
    the default Impress templates also make use of it, so not having it only
    displays white background...
    
    Change-Id: I34ffab7389fce60941fd926673a4999d40c50190
    (cherry picked from commit 888535f1c4e8617786c1cb6151aa5ef992b0c30f)

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 8bec1fe..819f1bb 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -275,6 +275,7 @@ calc_constructor_list = [
 
 draw_factory_list = [
     ("libsdlo.a", "sd_component_getFactory"),
+    ("libsvgiolo.a", "svgio_component_getFactory"),
     ("libsvgfilterlo.a", "svgfilter_component_getFactory"),
     ("libdeployment.a", "deployment_component_getFactory"),
     ("libemboleobj.a", "emboleobj_component_getFactory"),
commit b164120cfaeaed881884156a10e6fa663031b202
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Oct 2 09:08:54 2015 +0200

    tdf#88801 android: add services needed to load flat ODF documents
    
    Change-Id: I5767fa9a240b23de098fc6012555691dfb22c400
    (cherry picked from commit 9aa6ec9bfaa3c76c291ab8ec9a1b87fb89b817e6)

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 24cb818..8bec1fe 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -56,6 +56,10 @@ core_factory_list = [
     ("libxstor.a", "xstor_component_getFactory"),
     ("libvclcanvaslo.a", "vclcanvas_component_getFactory"),
     ("libmtfrendererlo.a", "mtfrenderer_component_getFactory"),
+    ("libxmlfdlo.a", "xmlfd_component_getFactory"),
+    ("libxmlfalo.a", "xmlfa_component_getFactory"),
+    ("libodfflatxmllo.a", "odfflatxml_component_getFactory"),
+    ("libxmlscriptlo.a", "xmlscript_component_getFactory"),
     ]
 
 core_constructor_list = [
commit 75fc4ebaca036d1e11bc6bab53c148af5dbfe1eb
Author: Tor Lillqvist <tml at collabora.com>
Date:   Sat Sep 19 18:29:59 2015 +0300

    We hardly want xsec stuff for iOS if not for Android either
    
    Change-Id: Ic6485b060eceb47dc96ee102733f308d71beedb8
    (cherry picked from commit ffaab97ac9a20476185d238b399c7ad093231af3)

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 44b1515..24cb818 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -52,7 +52,7 @@ core_factory_list = [
     ("libxmlsecurity.a", "xmlsecurity_component_getFactory"),
     ("libxoflo.a", "xof_component_getFactory"),
     ("libxolo.a", "xo_component_getFactory"),
-    ("libxsec_xmlsec.a", "xsec_xmlsec_component_getFactory", "#ifndef ANDROID"),
+    ("libxsec_xmlsec.a", "xsec_xmlsec_component_getFactory", "#if !defined ANDROID && !defined IOS"),
     ("libxstor.a", "xstor_component_getFactory"),
     ("libvclcanvaslo.a", "vclcanvas_component_getFactory"),
     ("libmtfrendererlo.a", "mtfrenderer_component_getFactory"),
commit 1e9cb180ae1adef34fbd0bf79f4832e590bfd7fe
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu May 21 15:04:07 2015 +0100

    Fix thinko
    
    (cherry picked from commit 3e3390e9236564f4becef9f61197aa1dcb93f7f6)

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 1df3280..44b1515 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -465,7 +465,7 @@ print ("""
 if options.java:
     print ("""
     extern void Java_org_libreoffice_kit_LibreOfficeKit_initializeNative();
-    p = (void *) Java_org_libreoffice_kit_LibreOfficeKit_initializeNative;
+    volatile void *p = (void *) Java_org_libreoffice_kit_LibreOfficeKit_initializeNative;
 
     extern void Java_org_libreoffice_kit_Office_getError();
     p = (void *) Java_org_libreoffice_kit_Office_getError;
commit da21f9eda27cb5a0c772d01e0dbd038e2dcaa905
Author: Jacobo Aragunde Pérez <jaragunde at igalia.com>
Date:   Wed Jun 10 14:26:10 2015 +0000

    Android: fix ownCloud lib build
    
    The build relied on the presence of ANDROID_HOME envvar, now we pass
    it explicitly.
    
    Change-Id: If33ee2c6a22435151aad244378ee5aaf7b3cc913
    (cherry picked from commit 2e6ed9befe172bcbfb14d5386bf3e0f151d0d666)

diff --git a/external/owncloud-android-lib/ExternalProject_owncloud_android_lib.mk b/external/owncloud-android-lib/ExternalProject_owncloud_android_lib.mk
index 21081c4..679981b 100644
--- a/external/owncloud-android-lib/ExternalProject_owncloud_android_lib.mk
+++ b/external/owncloud-android-lib/ExternalProject_owncloud_android_lib.mk
@@ -18,6 +18,7 @@ $(call gb_ExternalProject_get_state_target,owncloud_android_lib,build) :
 	$(ICECREAM_RUN) "$(ANT)" \
 		-q \
 		-f build.xml \
+		-Dsdk.dir=$(ANDROID_SDK_HOME) \
 		release \
 	)
 
commit 7bfacc1cb69cf115293569430bb26dd574ba5a5d
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu May 21 15:24:59 2015 +0100

    Bin unused code
    
    (cherry picked from commit ff2c4ee8a5416c90b1344cb95b69483156d4d210)

diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx
index 03ddd0b..82c4a33 100644
--- a/vcl/android/androidinst.cxx
+++ b/vcl/android/androidinst.cxx
@@ -38,90 +38,6 @@ public:
     virtual bool ErrorTrapPop( bool ) { return false; }
 };
 
-static void BlitFrameRegionToWindow(ANativeWindow_Buffer *pOutBuffer,
-                                    const basebmp::BitmapDeviceSharedPtr& aDev,
-                                    const ARect &rSrcRect,
-                                    int nDestX, int nDestY)
-{
-    basebmp::RawMemorySharedArray aSrcData = aDev->getBuffer();
-    basegfx::B2IVector aDevSize = aDev->getSize();
-    sal_Int32 nStride = aDev->getScanlineStride();
-    unsigned char *pSrc = aSrcData.get();
-
-    // FIXME: do some cropping goodness on aSrcRect to ensure no overflows etc.
-    ARect aSrcRect = rSrcRect;
-
-    for (unsigned int y = 0; y < (unsigned int)(aSrcRect.bottom - aSrcRect.top); y++)
-    {
-        unsigned char *sp = ( pSrc + nStride * (aSrcRect.top + y) +
-                              aSrcRect.left * 4 /* src pixel size */ );
-
-        switch (pOutBuffer->format) {
-        case WINDOW_FORMAT_RGBA_8888:
-        case WINDOW_FORMAT_RGBX_8888:
-        {
-            unsigned char *dp = ( (unsigned char *)pOutBuffer->bits +
-                                  pOutBuffer->stride * 4 * (y + nDestY) +
-                                  nDestX * 4 /* dest pixel size */ );
-            for (unsigned int x = 0; x < (unsigned int)(aSrcRect.right - aSrcRect.left); x++)
-            {
-                dp[x*4 + 0] = sp[x*4 + 0]; // R
-                dp[x*4 + 1] = sp[x*4 + 1]; // G
-                dp[x*4 + 2] = sp[x*4 + 2]; // B
-                dp[x*4 + 3] = 255; // A
-            }
-            break;
-        }
-        case WINDOW_FORMAT_RGB_565:
-        {
-            unsigned char *dp = ( (unsigned char *)pOutBuffer->bits +
-                                  pOutBuffer->stride * 2 * (y + nDestY) +
-                                  nDestX * 2 /* dest pixel size */ );
-            for (unsigned int x = 0; x < (unsigned int)(aSrcRect.right - aSrcRect.left); x++)
-            {
-                unsigned char b = sp[x*3 + 0]; // B
-                unsigned char g = sp[x*3 + 1]; // G
-                unsigned char r = sp[x*3 + 2]; // R
-                dp[x*2 + 0] = (r & 0xf8) | (g >> 5);
-                dp[x*2 + 1] = ((g & 0x1c) << 5) | ((b & 0xf8) >> 3);
-            }
-            break;
-        }
-        default:
-            LOGI("unknown pixel format %d !", pOutBuffer->format);
-            break;
-        }
-    }
-}
-
-void AndroidSalInstance::BlitFrameToWindow(ANativeWindow_Buffer *pOutBuffer,
-                                           const basebmp::BitmapDeviceSharedPtr& aDev)
-{
-    basegfx::B2IVector aDevSize = aDev->getSize();
-    ARect aWhole = { 0, 0, aDevSize.getX(), aDevSize.getY() };
-    BlitFrameRegionToWindow(pOutBuffer, aDev, aWhole, 0, 0);
-}
-
-void AndroidSalInstance::RedrawWindows(ANativeWindow_Buffer *pBuffer)
-{
-    if (pBuffer->bits != NULL)
-    {
-        int i = 0;
-        std::list< SalFrame* >::const_iterator it;
-        for ( it = getFrames().begin(); it != getFrames().end(); i++, ++it )
-        {
-            SvpSalFrame *pFrame = static_cast<SvpSalFrame *>(*it);
-
-            if (pFrame->IsVisible())
-            {
-                BlitFrameToWindow (pBuffer, pFrame->getDevice());
-            }
-        }
-    }
-    else
-        LOGI("no buffer for locked window");
-}
-
 void AndroidSalInstance::damaged(AndroidSalFrame */* frame */)
 {
     static bool beenHere = false;
@@ -148,29 +64,6 @@ void AndroidSalInstance::GetWorkArea( Rectangle& rRect )
                        Size( viewWidth, viewHeight ) );
 }
 
-/*
- * Try too hard to get a frame, in the absence of anything better to do
- */
-SalFrame *AndroidSalInstance::getFocusFrame() const
-{
-    SalFrame *pFocus = SvpSalFrame::GetFocusFrame();
-    if (!pFocus) {
-        LOGI("no focus frame, re-focusing first visible frame");
-        const std::list< SalFrame* >& rFrames( getFrames() );
-        for( std::list< SalFrame* >::const_iterator it = rFrames.begin(); it != rFrames.end(); ++it )
-        {
-            SvpSalFrame *pFrame = const_cast<SvpSalFrame*>(static_cast<const SvpSalFrame*>(*it));
-            if( pFrame->IsVisible() )
-            {
-                pFrame->GetFocus();
-                pFocus = pFrame;
-                break;
-            }
-        }
-    }
-    return pFocus;
-}
-
 AndroidSalInstance *AndroidSalInstance::getInstance()
 {
     if (!ImplGetSVData())
diff --git a/vcl/inc/android/androidinst.hxx b/vcl/inc/android/androidinst.hxx
index 79dad74..f99de12 100644
--- a/vcl/inc/android/androidinst.hxx
+++ b/vcl/inc/android/androidinst.hxx
@@ -42,9 +42,6 @@ public:
     // mainloop pieces
     virtual bool AnyInput( VclInputFlags nType );
 
-    void RedrawWindows(ANativeWindow_Buffer *pBuffer);
-    SalFrame *getFocusFrame() const;
-
     void      damaged(AndroidSalFrame *frame);
 };
 
commit 10409e70a2b695797754179f35cca386dab26457
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu May 21 14:54:58 2015 +0100

    WaE: macro "LOGW" is not used
    
    (cherry picked from commit f7d886ca038cd0a67738e6afe33ee002982d4cae)

diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx
index d1b760d..03ddd0b 100644
--- a/vcl/android/androidinst.cxx
+++ b/vcl/android/androidinst.cxx
@@ -23,7 +23,6 @@
 
 #define LOGTAG "LibreOffice/androidinst"
 #define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, LOGTAG, __VA_ARGS__))
-#define LOGW(...) ((void)__android_log_print(ANDROID_LOG_WARN, LOGTAG, __VA_ARGS__))
 #define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, LOGTAG, __VA_ARGS__))
 
 static jclass appClass = 0;
commit 61b691db0dd9fc821ba62435fb449f4d3c00097a
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Oct 15 08:49:06 2015 +0200

    android: show flat ODS files in the doc browser
    
    I forgot about this when I enabled other Calc file types in
    07997cba7745997d7e2ed908a8764ba1f0777f1e (android: adapt doc browser to
    updated manifest that accepts Calc documents, 2015-01-19).
    
    Change-Id: Iabacffbfc09d806f09bc7e0f9307830bda8ebbe1
    (cherry picked from commit 1956b50e3b4c63a913151fd21d21c42cd288173d)

diff --git a/android/source/src/java/org/libreoffice/ui/FileUtilities.java b/android/source/src/java/org/libreoffice/ui/FileUtilities.java
index 1ca3837..ce3953e 100644
--- a/android/source/src/java/org/libreoffice/ui/FileUtilities.java
+++ b/android/source/src/java/org/libreoffice/ui/FileUtilities.java
@@ -59,7 +59,7 @@ public class FileUtilities {
         mExtnMap.put(".fodt", DOC);
         mExtnMap.put(".fodg", DRAWING);
         mExtnMap.put(".fodp",  IMPRESS);
-        // mExtnMap.put(".fods",  CALC);
+        mExtnMap.put(".fods",  CALC);
 
         // ODF templates
         mExtnMap.put(".ott", DOC);
commit a8b15cf6dde500235c84dbeb3769e2385512e2b8
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Wed Oct 14 21:20:33 2015 +0200

    allow using Android Studio with lldb to debug native part
    
    and of course also for the Java part
    
    Using build-id linker flag allows lldb to map the installed .so to the
    non-stripped version on the buildhost.
    
    Also ndk-gdb supports specifying a different package name on the
    commandline, so no need for the error in configure anymore.
    
    Change-Id: If6887a27cc8ab15ee6ab612502cacf0a22ade737
    (cherry picked from commit 8840a66faceb5ebff2e6021e9b14da691d420234)

diff --git a/android/Bootstrap/Makefile.shared b/android/Bootstrap/Makefile.shared
index bfac36e..2edf7c3 100644
--- a/android/Bootstrap/Makefile.shared
+++ b/android/Bootstrap/Makefile.shared
@@ -45,7 +45,7 @@ WHOLELIBS = \
 
 $(OBJLOCAL)/liblo-native-code.so : native-code.cxx $(ALL_STATIC_LIBS)
 	mkdir -p $(OBJLOCAL)
-	$(CXX) -Wl,--gc-sections -Wl,--version-script=../Bootstrap/version.map -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -o $(OBJLOCAL)/liblo-native-code.so -I$(BUILDDIR)/config_host -I$(SRCDIR)/include native-code.cxx -L$(INSTDIR)/$(LIBO_LIB_FOLDER) $(WHOLELIBS) $(LIBS) -lgnustl_static -lGLESv2 -landroid -ljnigraphics -llog -lz
+	$(CXX) -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--version-script=../Bootstrap/version.map -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -o $(OBJLOCAL)/liblo-native-code.so -I$(BUILDDIR)/config_host -I$(SRCDIR)/include native-code.cxx -L$(INSTDIR)/$(LIBO_LIB_FOLDER) $(WHOLELIBS) $(LIBS) -lgnustl_static -lGLESv2 -landroid -ljnigraphics -llog -lz
 
 $(SODEST)/liblo-native-code.so : $(OBJLOCAL)/liblo-native-code.so
 	mkdir -p $(SODEST)
diff --git a/android/README b/android/README
index 8f40d5a..3f90a07 100644
--- a/android/README
+++ b/android/README
@@ -8,8 +8,8 @@ Contains common code for all projects on Android to bootstrap LibreOffice. In
 addition it is a home to LibreOfficeKit (LOK - see libreofficekit/README) JNI
 classes.
 
-LOAndroid3 (in experimental)
-****************************
+stuff in source directory
+*************************
 
 LibreOffice Android application - the code is based on Fennec (Firefox for Android).
 It uses OpenGL ES 2 for rendering of the document tiles which are gathered from
@@ -158,7 +158,7 @@ For instructions on how to build for Android, see README.cross.
 Attach your device, so 'adb devices' shows it. Then run:
 
         cd android/source
-        ant debug install
+        make install
         adb logcat
 
 and if all goes well, you should have some nice debug output to enjoy when you
@@ -187,7 +187,8 @@ space on your emulator's or device's /data volume. You can do:
 
         adb shell stop; adb shell start
 
-* Debugging
+Debugging
+---------
 
 First of all, you need to configure the build with --enable-debug or
 --enable-dbgutil.  You may want to provide --enable-selective-debuginfo too,
@@ -198,6 +199,8 @@ Building with all symbols is also possible but the linking is currently
 slow (around 10 to 15 minutes) and you need lots of memory (around 16GB + some
 swap).
 
+* Using ndk-gdb
+
 When you have all this, install the .apk to the device, and:
 
         cd android/source
@@ -225,11 +228,32 @@ rtl::OString, you need:
         (gdb) python sys.path.insert(0, "/master/solenv/gdb")
         (gdb) source /master/instdir/program/libuno_sal.so.3-gdb.py
 
+* Using Android Studio (and thus lldb)
+
+Note that both might not yield the same results - so if lldb doesn't show you
+useful info, try with the ndk-gdb method and the other way round.
+
+    - open android/source/build.gradle in Android Studio via File|New → Import Project
+    - make sure you select the right build variant (strippedUIDebug is what you want)
+    - use Run|Edit Configurations to create a new configuration of type "Android Native"
+        - on tab "General" pick module "source"
+        - on tab "Native Debugger" add android/source/obj/local/<hostarch> to
+          the Symbol directories
+
+Then you can select your new configuration and use Run | Debug to launch it.
+Note that lldb doesn't initially stop execution, so if you want to add
+breakpoints using lldb prompt, you manually have to pause execution, then you
+can witch to the lldb tab and add your breakpoints. However making use of the
+editor just using File|Open .. to open the desired file in Android Studio and
+then toggling the breakpoint by clicking on the margin is more comfortable.
+
 * Debugging the Java part
 
-At the moment the code is not organized in a way that would make Eclipse or
-Android Studio happy as-is, so the quickest way is to use the jdb command-line
-debugger. Steps to use it:
+Open android/source/build.gradle in Android studio via File|New → Import
+Project and you can use Android Studio's debugging interface.
+Just make sure you pick the correct build variant (strippedUIDebug)
+
+The alternative is to use the jdb command-line debugger. Steps to use it:
 
 1) Find out the JDWP ID of a debuggable application:
 
diff --git a/configure.ac b/configure.ac
index 51a70a8..8423fb4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12483,10 +12483,6 @@ if echo "$host_os" | grep -q linux-android ; then
 
         AC_MSG_RESULT([not set, using $ANDROID_PACKAGE_NAME])
     else
-        if test -n "$ENABLE_DEBUG" -a "$with_android_package_name" != "org.libreoffice" ; then
-            AC_MSG_ERROR([The package name must be set
-to org.libreoffice when debugging, please avoid --with-android-package-name.])
-        fi
         ANDROID_PACKAGE_NAME="$with_android_package_name"
         AC_MSG_RESULT([$ANDROID_PACKAGE_NAME])
     fi
commit d6dcc38235c665039752379f4d7fdc3933de4a09
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Wed Oct 14 02:32:57 2015 +0200

    make ndk-gdb work again
    
    it hardcodes so much :-(
    
    Change-Id: Id86c2bcbf5936f3ab292e87210b967e2331c9435
    (cherry picked from commit 78cf4ca4405d33d3f658da0d7f209afc8e6ee4a7)

diff --git a/android/.gitignore b/android/.gitignore
index 0487562..c937757 100644
--- a/android/.gitignore
+++ b/android/.gitignore
@@ -5,9 +5,11 @@
 /source/assets_strippedUI/
 /source/build/
 /source/captures/
+/source/jni/Application.mk
 /source/jniLibs/
 /source/jniLibs_debug/
 /source/liboSettings.gradle
+/source/libs/*/gdb.setup
 /source/local.properties
 /source/native-code.cxx
 /source/obj/
diff --git a/android/README b/android/README
index 513444c..8f40d5a 100644
--- a/android/README
+++ b/android/README
@@ -198,16 +198,25 @@ Building with all symbols is also possible but the linking is currently
 slow (around 10 to 15 minutes) and you need lots of memory (around 16GB + some
 swap).
 
-You also want to avoid --with-android-package-name (or when you use
-that, you must set it to "org.libreoffice"), otherwise ndk-gdb will complain:
-
-	ERROR: Could not extract package's data directory. Are you sure that
-	       your installed application is debuggable?
-
 When you have all this, install the .apk to the device, and:
 
         cd android/source
-        <android-ndk-r10d>/ndk-gdb --adb=<android-sdk-linux>/platform-tools/adb --start
+        <ndk-bundle>/ndk-gdb --adb=<android-sdk-linux>/platform-tools/adb [--start]
+
+In case you used --with-android-package-name, add --package=your.package.name
+to the invocation
+
+If you get the error
+
+        ERROR: Could not find gdb.setup under ./libs/
+
+(and an empty "Compatible device ABI:" when run with --verbose), you need to fix
+the quoting in the ndk-gdb script:
+
+@@ -574 +574 @@
+-adb_var_shell BCFILES run-as $PACKAGE_NAME /system/bin/sh -c "ls lib/*.bc"
++adb_var_shell BCFILES run-as $PACKAGE_NAME /system/bin/sh -c \"ls lib/*.bc\"
+
 
 Pretty printers aren't loaded automatically due to the single shared
 object, but you can still load them manually. E.g. to have a pretty-printer for
diff --git a/android/source/AndroidManifest.xml b/android/source/AndroidManifest.xml
index f15e66f..7721c69 100644
--- a/android/source/AndroidManifest.xml
+++ b/android/source/AndroidManifest.xml
@@ -13,6 +13,7 @@
         android:allowBackup="true"
         android:icon="@drawable/main"
         android:label="@string/app_name"
+        android:debuggable="true"
         android:hardwareAccelerated="true"
         android:largeHeap="false">
 
@@ -94,7 +95,7 @@
         </activity>
 
         <!-- Document Browser Activity -->
-        <activity android:name=".ui.LibreOfficeUIActivity"
+        <activity android:name="org.libreoffice.ui.LibreOfficeUIActivity"
                   android:label="@string/app_name"
                   android:theme="@style/BrowserTheme">
             <intent-filter>
diff --git a/android/source/ReleaseManifest.xml b/android/source/ReleaseManifest.xml
new file mode 100644
index 0000000..e412fe9
--- /dev/null
+++ b/android/source/ReleaseManifest.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools">
+    <application android:debuggable="false" tools:replace="android:debuggable"/>
+</manifest>
+<!-- vim: shiftwidth=4 softtabstop=4 expandtab:
+-->
diff --git a/android/source/build.gradle b/android/source/build.gradle
index 3f476c2..80772b2 100644
--- a/android/source/build.gradle
+++ b/android/source/build.gradle
@@ -24,7 +24,6 @@ dependencies {
     ])
     compile files("${liboInstdir}/${liboShareJavaFolder}/unoil.jar")
     compile files("${liboWorkdir}/UnpackedTarball/owncloud_android_lib/bin/owncloud-android-library.jar")
-    compile 'com.android.support:support-v4:23.0.1'
     compile 'com.android.support:appcompat-v7:23.0.1'
 }
 
@@ -39,18 +38,24 @@ android {
     // ToDo move to conventional layout, so stuff can be stripped down.
     sourceSets {
         main.manifest.srcFile 'AndroidManifest.xml'
+        // override the debuggable flag that needs to be in AndroidManifest.xml
+        // since ndk-gdb awks for the literal string in there :-/
+        release.manifest.srcFile 'ReleaseManifest.xml'
         main.assets.srcDirs = ['assets']
         main.res.srcDirs = ['res']
         main.java.srcDirs = ['../Bootstrap/src', 'src/java']
         main.jniLibs.srcDirs = ['jniLibs']
         main.jni.srcDirs = [] // don't attempt to build native-lib via gradle
-        // gdbserver stuff from separate dir
+        // gdbserver for debugvariant
         debug.jniLibs.srcDirs "jniLibs_debug"
         // the configuration data that might be stripped or not
         fullUI.assets.srcDirs 'assets_fullUI'
         strippedUI.assets.srcDirs 'assets_strippedUI'
     }
-    // defaults for Manifest
+    lintOptions {
+        // ndk-gdb looks for the literal value in the pre-processed manifest :-(
+        disable 'HardcodedDebugMode'
+    }
     defaultConfig {
         minSdkVersion 14
         // openssl on x86 makes the native-code.so contain text-relocations,
@@ -197,16 +202,24 @@ task createStrippedConfigRegistry(type: Exec) {
     }
 }
 
+// ndk-gdb requires the gdb.setup to be in libs/<arch>/ folder - it's hardcoded in the script
+// it should in theory also be able to copy the gdbserver binary onto the device, but the matching
+// against prebuilt archs is too rudimentary and doesn't map armeabi-v7 to arm for example
 task copyNdkDebugServer(type: Copy) {
-    description "copies gdbserver into and creates gdb.setup in the debug-type only native directory"
+    description "copies gdbserver into and creates gdb.setup and Application.mk for use with ndk-gdb"
     inputs.file "liboSettings.gradle"
-    def gdbsetup = file("jniLibs_debug/${liboAndroidAppAbi}/gdb.setup")
-    outputs.file gdbsetup
+    def gdbsetup = file("libs/${liboAndroidAppAbi}/gdb.setup") // only needed on buildhost
+    // hardcoded path from ndk-gdb - reads the host architecture from that file
+    def applicationmk = file("jni/Application.mk")
+    outputs.files gdbsetup, applicationmk
     outputs.dir 'jniLibs_debug' // own the directory, so it is removed on this task's clean
+    outputs.dir 'libs' // own the directory, so it is removed on this task's clean
     into "jniLibs_debug/${liboAndroidAppAbi}"
     from "${liboNdkGdbserver}"
     doLast {
-        gdbsetup.text = "set solib-search-path ./obj/local/${liboAndroidAppAbi}"
+        file("libs/${liboAndroidAppAbi}").mkdirs()
+        gdbsetup.text = "set solib-search-path ./obj/local/${liboAndroidAppAbi}\n"
+        applicationmk.text = "APP_ABI := ${liboAndroidAppAbi}\n"
     }
 }
 
commit 3f2bf1133f29930262b410fe66fee288fbb44524
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Mon Oct 12 02:48:53 2015 +0200

    android can only target sdk 22 - openssl triggers text relocation errors
    
     scanelf -T android/source/obj/local/x86/liblo-native-code.so
     TYPE   TEXTRELS FILE
      liblo-native-code.so: (memory/data?) [0x30E35B6] in (optimized out: previous OPENSSL_rdtsc) [0x30E35B0]
      liblo-native-code.so: (memory/data?) [0x30E35D2] in (optimized out: previous OPENSSL_instrument_halt) [0x30E35D0]
      liblo-native-code.so: (memory/data?) [0x30E3646] in (optimized out: previous OPENSSL_wipe_cpu) [0x30E3640]
      liblo-native-code.so: (memory/data?) [0x30E494C] in (optimized out: previous sha1_block_data_order) [0x30E4940]
      liblo-native-code.so: (memory/data?) [0x30E79BA] in (optimized out: previous sha512_block_data_order) [0x30E7980]
      liblo-native-code.so: (memory/data?) [0x30EB7B2] in (optimized out: previous AES_encrypt) [0x30EB780]
      liblo-native-code.so: (memory/data?) [0x30ECDF2] in (optimized out: previous AES_decrypt) [0x30ECDC0]
      liblo-native-code.so: (memory/data?) [0x30ECE89] in (optimized out: previous AES_cbc_encrypt) [0x30ECE70]
    ET_DYN  android/source/obj/local/x86/liblo-native-code.so
    
    with target level 22 it is only a warning:
    W/linker:
    /mnt/asec/org.documentfoundation.libreoffice-1/lib/x86/liblo-native-code.so has
    text relocations. This is wasting memory and prevents security hardening.
    Please fix.
    
    with target level 23 it is java.lang.UnsatisfiedLinkError
    
    Change-Id: Ia55c75c46a64854e46aab3329fef3e9b522a5ba2
    (cherry picked from commit 5b791ec5e0bd6e05769bf9683d9e1f8b3344b9a5)

diff --git a/android/source/build.gradle b/android/source/build.gradle
index 8e2355c..3f476c2 100644
--- a/android/source/build.gradle
+++ b/android/source/build.gradle
@@ -53,7 +53,10 @@ android {
     // defaults for Manifest
     defaultConfig {
         minSdkVersion 14
-        targetSdkVersion 23
+        // openssl on x86 makes the native-code.so contain text-relocations,
+        // 22 treats them as warnings, on 23 it is fatal error
+        // ToDo: fix openssl stuff to not block targeting 23 or later
+        targetSdkVersion 22
         manifestPlaceholders = [installLocation: "preferExternal"]
     }
     buildTypes {
commit 9e5aa9632c25a2b9d4c9ee738072f8bcc59e3daa
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Sun Oct 11 18:10:20 2015 +0200

    tdf#94891 fix crash when rotating screen in docbrowser right after launch
    
    will likely also lose the current directory, but much better than
    crashing.
    
    Change-Id: I9ce20e1954a6f58325413046e258ded75b6c8848
    (cherry picked from commit b6430ed7fd4b6d3656f70f98ea1b089e049a3847)

diff --git a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
index 5290a50..29229e1 100644
--- a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
+++ b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
@@ -82,6 +82,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements ActionBa
     private IFile currentDirectory;
 
     private static final String CURRENT_DIRECTORY_KEY = "CURRENT_DIRECTORY";
+    private static final String DOC_PROIVDER_KEY = "CURRENT_DOCUMENT_PROVIDER";
     private static final String FILTER_MODE_KEY = "FILTER_MODE";
     public static final String EXPLORER_VIEW_TYPE_KEY = "EXPLORER_VIEW_TYPE";
     public static final String EXPLORER_PREFS_KEY = "EXPLORER_PREFS";
@@ -610,8 +611,9 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements ActionBa
         // TODO Auto-generated method stub
         super.onSaveInstanceState(outState);
         outState.putString(CURRENT_DIRECTORY_KEY, currentDirectory.getUri().toString());
-        outState.putInt(FILTER_MODE_KEY , filterMode);
+        outState.putInt(FILTER_MODE_KEY, filterMode);
         outState.putInt(EXPLORER_VIEW_TYPE_KEY , viewMode);
+        outState.putInt(DOC_PROIVDER_KEY, documentProvider.getId());
 
         Log.d(LOGTAG, currentDirectory.toString() + Integer.toString(filterMode) + Integer.toString(viewMode));
         //prefs.edit().putInt(EXPLORER_VIEW_TYPE, viewType).commit();
@@ -625,14 +627,19 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements ActionBa
         if (savedInstanceState.isEmpty()){
             return;
         }
+        if (documentProvider == null) {
+            Log.d(LOGTAG, "onRestoreInstanceState - documentProvider is null");
+            documentProvider = DocumentProviderFactory.getInstance()
+                    .getProvider(savedInstanceState.getInt(DOC_PROIVDER_KEY));
+        }
         try {
             currentDirectory = documentProvider.createFromUri(new URI(
                     savedInstanceState.getString(CURRENT_DIRECTORY_KEY)));
         } catch (URISyntaxException e) {
             currentDirectory = documentProvider.getRootDirectory();
         }
-        filterMode = savedInstanceState.getInt(FILTER_MODE_KEY , FileUtilities.ALL) ;
-        viewMode = savedInstanceState.getInt(EXPLORER_VIEW_TYPE_KEY , GRID_VIEW);
+        filterMode = savedInstanceState.getInt(FILTER_MODE_KEY, FileUtilities.ALL);
+        viewMode = savedInstanceState.getInt(EXPLORER_VIEW_TYPE_KEY, GRID_VIEW);
         //openDirectory(currentDirectory);
         Log.d(LOGTAG, "onRestoreInstanceState");
         Log.d(LOGTAG, currentDirectory.toString() + Integer.toString(filterMode) + Integer.toString(viewMode));
commit 7f87188e9a35cb8ab06a94ede5504c5d49993766
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Sun Oct 11 01:52:39 2015 +0200

    move extracting assets to Java & use AssetManager to access assets
    
    using AssetsManager in both java as well as native parts allows to
    handle files both with and without compression transparently
    
    Change-Id: If02f1159c498be7ea965fd9c217410722f2dca1f
    (cherry picked from commit 143fb0a4b5d4ab69d4928299d8112ab95d99870a)

diff --git a/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java b/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java
index 431c384..b2fb5e1 100644
--- a/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java
+++ b/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java
@@ -11,6 +11,7 @@ package org.libreoffice.kit;
 
 import android.app.Activity;
 import android.content.pm.ApplicationInfo;
+import android.content.res.AssetManager;
 import android.util.Log;
 
 import java.io.File;
@@ -24,6 +25,7 @@ import java.nio.ByteBuffer;
 public final class LibreOfficeKit
 {
     private static String LOGTAG = LibreOfficeKit.class.getSimpleName();
+    private static AssetManager mgr;
 
     // private constructor because instantiating would be meaningless
     private LibreOfficeKit() {
@@ -34,7 +36,7 @@ public final class LibreOfficeKit
     }
 
     // Trigger initialization on the JNI - LOKit side.
-    private static native boolean initializeNative(String dataDir, String cacheDir, String apkFile);
+    private static native boolean initializeNative(String dataDir, String cacheDir, String apkFile, AssetManager mgr);
 
     public static native ByteBuffer getLibreOfficeKitHandle();
 
@@ -55,6 +57,8 @@ public final class LibreOfficeKit
             return;
         }
 
+        mgr = activity.getResources().getAssets();
+
         ApplicationInfo applicationInfo = activity.getApplicationInfo();
         String dataDir = applicationInfo.dataDir;
         Log.i(LOGTAG, String.format("Initializing LibreOfficeKit, dataDir=%s\n", dataDir));
@@ -83,7 +87,7 @@ public final class LibreOfficeKit
         // TMPDIR is used by osl_getTempDirURL()
         putenv("TMPDIR=" + cacheDir);
 
-        if (!initializeNative(dataDir, cacheDir, apkFile)) {
+        if (!initializeNative(dataDir, cacheDir, apkFile, mgr)) {
             Log.e(LOGTAG, "Initialize native failed!");
             return;
         }
diff --git a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
index 324423c..eb56607 100644
--- a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
+++ b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
@@ -6,6 +6,9 @@ import android.content.ContentResolver;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.res.AssetFileDescriptor;
+import android.content.res.AssetManager;
 import android.os.AsyncTask;
 import android.os.Bundle;
 import android.os.Handler;
@@ -33,9 +36,11 @@ import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
 import java.net.URI;
+import java.nio.ByteBuffer;
+import java.nio.channels.Channels;
+import java.nio.channels.FileChannel;
+import java.nio.channels.ReadableByteChannel;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -47,6 +52,7 @@ public class LibreOfficeMainActivity extends AppCompatActivity {
     private static final String LOGTAG = "LibreOfficeMainActivity";
     private static final String DEFAULT_DOC_PATH = "/assets/example.odt";
     private static final String ENABLE_EXPERIMENTAL_PREFS_KEY = "ENABLE_EXPERIMENTAL";
+    private static final String ASSETS_EXTRACTED_PREFS_KEY = "ASSETS_EXTRACTED";
 
     public static LibreOfficeMainActivity mAppContext;
 
@@ -147,9 +153,15 @@ public class LibreOfficeMainActivity extends AppCompatActivity {
         mAppContext = this;
         super.onCreate(savedInstanceState);
 
-        mEnableEditing = PreferenceManager.getDefaultSharedPreferences(getApplicationContext())
-                                          .getBoolean(ENABLE_EXPERIMENTAL_PREFS_KEY, false);
 
+        SharedPreferences sPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
+        mEnableEditing = sPrefs.getBoolean(ENABLE_EXPERIMENTAL_PREFS_KEY, false);
+
+        if (sPrefs.getInt(ASSETS_EXTRACTED_PREFS_KEY, 0) != BuildConfig.VERSION_CODE) {
+            if(copyFromAssets(getAssets(), "unpack", getApplicationInfo().dataDir)) {
+                sPrefs.edit().putInt(ASSETS_EXTRACTED_PREFS_KEY, BuildConfig.VERSION_CODE).apply();
+            }
+        }
         mMainHandler = new Handler();
 
         setContentView(R.layout.activity_main);
@@ -165,6 +177,7 @@ public class LibreOfficeMainActivity extends AppCompatActivity {
                     Log.d(LOGTAG, "SCHEME_CONTENT: getPath(): " + getIntent().getData().getPath());
                 } else {
                     // TODO: can't open the file
+                    Log.e(LOGTAG, "couldn't create temporary file from "+getIntent().getData());
                 }
             } else if (getIntent().getData().getScheme().equals(ContentResolver.SCHEME_FILE)) {
                 mInputFile = new File(getIntent().getData().getPath());
@@ -217,38 +230,42 @@ public class LibreOfficeMainActivity extends AppCompatActivity {
 
     private boolean copyFileToTemp() {
         ContentResolver contentResolver = getContentResolver();
-        InputStream inputStream = null;
+        FileChannel inputChannel = null;
+        FileChannel outputChannel = null;
+        // CSV files need a .csv suffix to be opened in Calc.
+        String suffix = null;
+        String intentType = getIntent().getType();
+        // K-9 mail uses the first, GMail uses the second variant.
+        if ("text/comma-separated-values".equals(intentType) || "text/csv".equals(intentType))
+            suffix = ".csv";
+
         try {
-            inputStream = contentResolver.openInputStream(getIntent().getData());
-
-            // CSV files need a .csv suffix to be opened in Calc.
-            String suffix = null;
-            String intentType = getIntent().getType();
-            // K-9 mail uses the first, GMail uses the second variant.
-            if ("text/comma-separated-values".equals(intentType) || "text/csv".equals(intentType))
-                suffix = ".csv";
-            mTempFile = File.createTempFile("LibreOffice", suffix, this.getCacheDir());
-
-            OutputStream outputStream = new FileOutputStream(mTempFile);
-            byte[] buffer = new byte[4096];
-            int len = 0;
-            while ((len = inputStream.read(buffer)) != -1) {
-                outputStream.write(buffer, 0, len);
+            try {
+                AssetFileDescriptor assetFD = contentResolver.openAssetFileDescriptor(getIntent().getData(), "r");
+                if (assetFD == null) {
+                    Log.e(LOGTAG, "couldn't create assetfiledescriptor from "+getIntent().getDataString());
+                    return false;
+                }
+                inputChannel = assetFD.createInputStream().getChannel();
+                mTempFile = File.createTempFile("LibreOffice", suffix, this.getCacheDir());
+
+                outputChannel = new FileOutputStream(mTempFile).getChannel();
+                long bytesTransferred = 0;
+                // might not  copy all at once, so make sure everything gets copied....
+                while (bytesTransferred < inputChannel.size()) {
+                    bytesTransferred += outputChannel.transferFrom(inputChannel, bytesTransferred, inputChannel.size());
+                }
+                Log.e(LOGTAG, "Success copying "+bytesTransferred+ " bytes");
+                return true;
+            } finally {
+                if (inputChannel != null) inputChannel.close();
+                if (outputChannel != null) outputChannel.close();
             }
-            inputStream.close();
-            outputStream.close();
-            return true;
         } catch (FileNotFoundException e) {
+            return false;
         } catch (IOException e) {
-        } finally {
-            if (inputStream != null) {
-                try {
-                    inputStream.close();
-                } catch (IOException e) {
-                }
-            }
+            return false;
         }
-        return false;
     }
 
     /**
@@ -362,6 +379,7 @@ public class LibreOfficeMainActivity extends AppCompatActivity {
 
         if (isFinishing()) { // Not an orientation change
             if (mTempFile != null) {
+                //noinspection ResultOfMethodCallIgnored
                 mTempFile.delete();
             }
         }
@@ -423,8 +441,6 @@ public class LibreOfficeMainActivity extends AppCompatActivity {
      * Hides software keyboard.
      */
     private void hideSoftKeyboardDirect() {
-        LayerView layerView = (LayerView) findViewById(R.id.layer_view);
-
         if (getCurrentFocus() != null) {
             InputMethodManager inputMethodManager = (InputMethodManager) getApplicationContext().getSystemService(Context.INPUT_METHOD_SERVICE);
             inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
@@ -471,6 +487,63 @@ public class LibreOfficeMainActivity extends AppCompatActivity {
             mDrawerLayout.closeDrawer(mDrawerList);
         }
     }
+
+    private static boolean copyFromAssets(AssetManager assetManager,
+                                           String fromAssetPath, String targetDir) {
+        try {
+            String[] files = assetManager.list(fromAssetPath);
+
+            boolean res = true;
+            for (String file : files) {
+                String[] dirOrFile = assetManager.list(fromAssetPath+"/"+file);
+                if ( dirOrFile.length == 0) {
+                    //noinspection ResultOfMethodCallIgnored
+                    new File(targetDir).mkdirs();
+                    res &= copyAsset(assetManager,
+                            fromAssetPath + "/" + file,
+                            targetDir + "/" + file);
+                } else
+                    res &= copyFromAssets(assetManager,
+                            fromAssetPath + "/" + file,
+                            targetDir + "/" + file);
+            }
+            return res;
+        } catch (Exception e) {
+            e.printStackTrace();
+            Log.e(LOGTAG, "copyFromAssets failed: " + e.getMessage());
+            return false;
+        }
+    }
+
+    private static boolean copyAsset(AssetManager assetManager, String fromAssetPath, String toPath) {
+        ReadableByteChannel source = null;
+        FileChannel dest = null;
+        try {
+            try {
+                source = Channels.newChannel(assetManager.open(fromAssetPath));
+                dest = new FileOutputStream(toPath).getChannel();
+                long bytesTransferred = 0;
+                // might not  copy all at once, so make sure everything gets copied....
+                ByteBuffer buffer = ByteBuffer.allocate(4096);
+                while (source.read(buffer)>0) {
+                    buffer.flip();
+                    bytesTransferred += dest.write(buffer);
+                    buffer.clear();
+                }
+                Log.v(LOGTAG, "Success copying "+fromAssetPath+" to "+toPath + " bytes: "+bytesTransferred);
+                return true;
+            } finally {
+                if (dest != null) dest.close();
+                if (source != null) source.close();
+            }
+        } catch (FileNotFoundException e) {
+            Log.e(LOGTAG, "file " + fromAssetPath + " not found! " + e.getMessage());
+            return false;
+        } catch (IOException e) {
+            Log.e(LOGTAG, "failed to copy file " + fromAssetPath + " from assets to " + toPath + " - " + e.getMessage());
+            return false;
+        }
+    }
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/osl/detail/android-bootstrap.h b/include/osl/detail/android-bootstrap.h
index b18531b..5a5c7fc 100644
--- a/include/osl/detail/android-bootstrap.h
+++ b/include/osl/detail/android-bootstrap.h
@@ -20,6 +20,7 @@ extern "C" {
 #endif
 
 #include <osl/detail/component-mapping.h>
+#include <android/asset_manager.h>
 
 typedef struct lo_apk_dir lo_apk_dir;
 
@@ -38,12 +39,10 @@ JavaVM *lo_get_javavm(void);
 
 const char *lo_get_app_data_dir(void);
 
-#define UNPACK_TREE "/assets/unpack"
-#define UNPACK_TREE_GZ "/assets/gz.unpack"
+AAssetManager *lo_get_native_assetmgr(void);
 
 int setup_cdir(void);
 int setup_assets_tree(void);
-void extract_files(const char *root, const char *prefix, int gzipped);
 
 #ifdef __cplusplus
 }
diff --git a/sal/android/libreofficekit-jni.c b/sal/android/libreofficekit-jni.c
index 41fa97e..c5f53c9 100644
--- a/sal/android/libreofficekit-jni.c
+++ b/sal/android/libreofficekit-jni.c
@@ -21,6 +21,8 @@
 #include <jni.h>
 
 #include <android/log.h>
+#include <android/asset_manager.h>
+#include <android/asset_manager_jni.h>
 
 #include <osl/detail/android-bootstrap.h>
 
@@ -34,6 +36,7 @@ extern const char* data_dir;
 extern const char* cache_dir;
 extern void* apk_file;
 extern int apk_file_size;
+AAssetManager* native_asset_manager;
 
 extern void Java_org_libreoffice_android_Bootstrap_putenv(JNIEnv* env, jobject clazz, jstring string);
 extern void Java_org_libreoffice_android_Bootstrap_redirect_1stdio(JNIEnv* env, jobject clazz, jboolean state);
@@ -63,7 +66,7 @@ void Java_org_libreoffice_kit_LibreOfficeKit_redirectStdio
 __attribute__ ((visibility("default")))
 jboolean Java_org_libreoffice_kit_LibreOfficeKit_initializeNative
     (JNIEnv* env, jobject clazz,
-     jstring dataDir, jstring cacheDir, jstring apkFile)
+     jstring dataDir, jstring cacheDir, jstring apkFile, jobject assetManager)
 {
     struct stat st;
     int fd;
@@ -76,6 +79,8 @@ jboolean Java_org_libreoffice_kit_LibreOfficeKit_initializeNative
 
     (void) clazz;
 
+    native_asset_manager = AAssetManager_fromJava(env, assetManager);
+
     dataDirPath = (*env)->GetStringUTFChars(env, dataDir, NULL);
     data_dir = strdup(dataDirPath);
     (*env)->ReleaseStringUTFChars(env, dataDir, dataDirPath);
@@ -122,10 +127,6 @@ jboolean Java_org_libreoffice_kit_LibreOfficeKit_initializeNative
         return JNI_FALSE;
     }
 
-    // Extract files from the .apk that can't be used mmapped directly from it
-    extract_files(UNPACK_TREE, UNPACK_TREE, 0);
-    extract_files(UNPACK_TREE_GZ, UNPACK_TREE_GZ, 1);
-
     // LibreOfficeKit expects a path to the program/ directory
     free(full_program_dir);
     data_dir_len = strlen(data_dir);
@@ -160,4 +161,12 @@ jobject Java_org_libreoffice_kit_LibreOfficeKit_getLibreOfficeKitHandle
     return (*env)->NewDirectByteBuffer(env, (void*) aOffice, sizeof(LibreOfficeKit));
 }
 
+__attribute__ ((visibility("default")))
+AAssetManager *
+lo_get_native_assetmgr(void)
+{
+        return native_asset_manager;
+}
+
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/android/lo-bootstrap.c b/sal/android/lo-bootstrap.c
index 5c47b8f..7a2da48 100644
--- a/sal/android/lo-bootstrap.c
+++ b/sal/android/lo-bootstrap.c
@@ -311,10 +311,6 @@ Java_org_libreoffice_android_Bootstrap_setup__Ljava_lang_String_2Ljava_lang_Stri
     if (!setup_assets_tree())
         return JNI_FALSE;
 
-    // Extract files from the .apk that can't be used mmapped directly from it
-    extract_files(UNPACK_TREE, UNPACK_TREE, 0);
-    extract_files(UNPACK_TREE_GZ, UNPACK_TREE_GZ, 1);
-
     return JNI_TRUE;
 }
 
@@ -635,184 +631,6 @@ lo_apk_lstat(const char *path,
     return -1;
 }
 
-static int
-mkdir_p(const char *dirname)
-{
-    char *p = malloc(strlen(dirname) + 1);
-    const char *q = dirname + 1;
-    const char *slash;
-
-    do {
-        slash = strchr(q, '/');
-        if (slash == NULL)
-            slash = q + strlen(q);
-        memcpy(p, dirname, slash-dirname);
-        p[slash-dirname] = '\0';
-        if (mkdir(p, 0700) == -1 && errno != EEXIST) {
-            LOGE("mkdir_p: Could not create %s: %s", p, strerror(errno));
-            free(p);
-            return 0;
-        }
-        if (*slash)
-            q = slash + 1;
-    } while (*slash);
-
-    free(p);
-    return 1;
-}
-
-static int
-extract_gzipped(const char *filename,
-                const char *apkentry,
-                int size,
-                FILE *f)
-{
-    gzFile gzfd;
-    int gzerrno;
-    int nbytes;
-    char buf[5000];
-    int total = 0;
-    char *tmpname;
-    FILE *tmp;
-
-    tmpname = malloc(strlen(cache_dir) + strlen("/tmp.gz") + 1);
-    strcpy(tmpname, cache_dir);
-    strcat(tmpname, "/tmp.gz");
-
-    tmp = fopen(tmpname, "w+");
-    unlink(tmpname);
-
-    if (tmp == NULL) {
-        LOGE("extract_gzipped: could not create %s: %s", tmpname, strerror(errno));
-        free(tmpname);
-        return 0;
-    }
-
-    if (fwrite(apkentry, size, 1, tmp) != 1) {
-        LOGE("extract_gzipped: could not write gzipped entry to %s: %s", tmpname, strerror(errno));
-        fclose(tmp);
-        free(tmpname);
-        return 0;
-    }
-
-    free(tmpname);
-    rewind(tmp);
-
-    gzfd = gzdopen(fileno(tmp), "rb");
-    if (gzfd == NULL) {
-        LOGE("extract_gzipped: gzdopen failed");
-        fclose(tmp);
-        return 0;
-    }
-
-    while ((nbytes = gzread(gzfd, buf, sizeof(buf))) > 0) {
-        fwrite(buf, nbytes, 1, f);
-        total += nbytes;
-    }
-    if (nbytes == -1) {
-        LOGE("extract_gzipped: Could not gzread from %s: %s", filename, gzerror(gzfd, &gzerrno));
-        return total;
-    }
-    if (gzclose(gzfd) == -1) {
-        LOGE("extract_gzipped: gzclose failed");
-        return total;
-    }
-
-    return total;
-}
-
-void
-extract_files(const char *root,
-              const char *prefix,
-              int gzipped)
-{
-    lo_apk_dir *tree = lo_apk_opendir(prefix);
-    struct dirent *dent;
-
-    if (tree == NULL)
-        return;
-
-    while ((dent = lo_apk_readdir(tree)) != NULL) {
-        if (strcmp(dent->d_name, ".") == 0 ||
-            strcmp(dent->d_name, "..") == 0)
-            continue;
-
-        if (dent->d_type == DT_DIR) {
-            char *subdir = malloc(strlen(prefix) + 1 + strlen(dent->d_name) + 1);
-            strcpy(subdir, prefix);
-            strcat(subdir, "/");
-            strcat(subdir, dent->d_name);
-            extract_files(root, subdir, gzipped);
-            free(subdir);
-        } else {
-            char *filename;
-            char *newfilename;
-            const char *apkentry;
-            size_t size;
-            struct stat st;
-            FILE *f;
-
-            filename = malloc(strlen(prefix) + 1 + strlen(dent->d_name) + 1);
-            strcpy(filename, prefix);
-            strcat(filename, "/");
-            strcat(filename, dent->d_name);
-
-            apkentry = lo_apkentry(filename, &size);
-            if (apkentry == NULL) {
-                LOGE("extract_files: Could not find %s in .apk", filename);
-                free(filename);
-                continue;
-            }
-
-            newfilename = malloc(strlen(data_dir) + 1 + strlen(prefix) - strlen(root) + strlen(dent->d_name) + 1);
-            strcpy(newfilename, data_dir);
-            strcat(newfilename, "/");
-            strcat(newfilename, prefix + strlen(root) + 1);
-
-            if (!mkdir_p(newfilename)) {
-                free(filename);
-                free(newfilename);
-                continue;
-            }
-
-            strcat(newfilename, "/");
-            strcat(newfilename, dent->d_name);
-
-            if (stat(newfilename, &st) == 0 &&
-                (gzipped || st.st_size == (long long) size)) {
-                free(filename);
-                free(newfilename);
-                continue;
-            }
-
-            f = fopen(newfilename, "w");
-            if (f == NULL) {
-                LOGE("extract_files: Could not open %s for writing: %s", newfilename, strerror(errno));
-                free(filename);
-                free(newfilename);
-                continue;
-            }
-
-            if (!gzipped) {
-                if (fwrite(apkentry, size, 1, f) != 1) {
-                    LOGE("extract_files: Could not write %lld bytes to %s: %s", (long long) size, newfilename, strerror(errno));
-                } else {
-                    LOGI("extract_files: Copied %s to %s: %lld bytes", filename, newfilename, (long long) size);
-                }
-            } else {
-                size = extract_gzipped(filename, apkentry, size, f);
-                LOGI("extract_files: Decompressed %s to %s: %lld bytes", filename, newfilename, (long long) size);
-            }
-
-            fclose(f);
-
-            free(filename);
-            free(newfilename);
-        }
-    }
-    lo_apk_closedir(tree);
-}
-
 /* Android's JNI works only to libraries loaded through Java's
  * System.loadLibrary(), it seems. But now with just one big app-specific .so
  * on Android, that would not be a problem, but for historical reasons, we
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 73612a3..a4664c9 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -56,6 +56,8 @@
 
 #ifdef ANDROID
 #include <osl/detail/android-bootstrap.h>
+#include <android/log.h>
+#include <android/asset_manager.h>
 #endif
 
 /*******************************************************************
@@ -829,6 +831,21 @@ openFilePath( const char *cpFilePath, oslFileHandle* pHandle, sal_uInt32 uFlags,
      */
     if (strncmp (cpFilePath, "/assets/", sizeof ("/assets/") - 1) == 0)
     {
+        void* address;
+        size_t size;
+        AAssetManager* mgr = lo_get_native_assetmgr();
+        AAsset* asset = AAssetManager_open(mgr, cpFilePath + sizeof("/assets/")-1, AASSET_MODE_BUFFER);
+        if (NULL == asset) {
+            address = NULL;
+            errno = ENOENT;
+            __android_log_print(ANDROID_LOG_ERROR,"libo:sal/osl/unx/file", "failed to open %s", cpFilePath);
+            return osl_File_E_NOENT;
+        } else {
+            size = AAsset_getLength(asset);
+            address = malloc (sizeof(char)*size);
+            AAsset_read (asset,address,size);
+            AAsset_close(asset);
+        }
         if (uFlags & osl_File_OpenFlag_Write)
         {
             // It seems to work better to silently "open" it read-only
@@ -836,15 +853,7 @@ openFilePath( const char *cpFilePath, oslFileHandle* pHandle, sal_uInt32 uFlags,
             // loading a document from /assets fails with that idiotic
             // "General Error" dialog...
         }
-        void *address;
-        size_t size;
-        address = lo_apkentry(cpFilePath, &size);
         SAL_INFO("sal.file", "osl_openFile(" << cpFilePath << ") => " << address);
-        if (address == NULL)
-        {
-            errno = ENOENT;
-            return osl_File_E_NOENT;
-        }
         return openMemoryAsFile(address, size, pHandle, cpFilePath);
     }
 #endif
@@ -1042,6 +1051,10 @@ SAL_CALL osl_closeFile( oslFileHandle Handle )
 
     if (pImpl->m_kind == FileHandle_Impl::KIND_MEM)
     {
+#ifdef ANDROID
+        free(pImpl->m_buffer);
+        pImpl->m_buffer = NULL;
+#endif
         delete pImpl;
         return osl_File_E_None;
     }
commit 9b35f433a63e6c6f45705e252fe7ae622b5e2742
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Sun Oct 11 01:53:29 2015 +0200

    migrate android build to gradle
    
    move preparation tasks (creating assets/processing files) from the
    makefile into the gradle script
    
    This allows much easier integration into android-studio (just open
    android/source with android studio after running make to compile the
    native library)
    
    (cherry picked from commit ee8257a1c70eadb7330b0ee99ec3b86fe4084bdf)
    
    Change-Id: I9a9d6832797c24a7e195a1c7954cd6d20f5a8496

diff --git a/.gitignore b/.gitignore
index e198d7f..3af6d8f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,7 +31,6 @@
 
 # autoconf generated stuff
 /aclocal.m4
-/android/source/AndroidManifest.xml
 /autom4te.cache
 /autogen.input
 /autogen.lastrun
diff --git a/Makefile.in b/Makefile.in
index 61cc906..914699e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -43,7 +43,6 @@ $(BUILDDIR)/config_host.mk : $(wildcard \
 		$(SRCDIR)/instsetoo_native/util/openoffice.lst.in \
 		$(SRCDIR)/configure.ac \
 		$(SRCDIR)/config_host/*.h.in \
-		$(SRCDIR)/android/source/AndroidManifest.xml.in \
 		$(BUILDDIR)/autogen.input \
 		$(BUILDDIR)/autogen.lastrun \
 		$(BUILDDIR)/autogen.sh \
diff --git a/android/.gitignore b/android/.gitignore
index 0f7e91b..0487562 100644
--- a/android/.gitignore
+++ b/android/.gitignore
@@ -1,8 +1,14 @@
-assets
-bin
-gen
-libs
-obj
-local.properties
-native-code.cxx
-AppCompat-v7
+/source/.gradle/
+/source/.idea/
+/source/assets/
+/source/assets_fullUI/
+/source/assets_strippedUI/
+/source/build/
+/source/captures/
+/source/jniLibs/
+/source/jniLibs_debug/
+/source/liboSettings.gradle
+/source/local.properties
+/source/native-code.cxx
+/source/obj/
+/source/source.iml
diff --git a/android/Bootstrap/.gitignore b/android/Bootstrap/.gitignore
deleted file mode 100644
index ad825c0..0000000
--- a/android/Bootstrap/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-no-resource-compress.xml
diff --git a/android/Bootstrap/AndroidManifest.xml b/android/Bootstrap/AndroidManifest.xml
deleted file mode 100644
index b602c87..0000000
--- a/android/Bootstrap/AndroidManifest.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-      package="org.libreoffice.kit"
-      android:versionCode="1"
-      android:versionName="1.0">
-    <application>
-        <activity android:name="org.libreoffice.kit.LibreOfficeKit" />
-    </application>
-</manifest>
diff --git a/android/Bootstrap/Makefile.shared b/android/Bootstrap/Makefile.shared
index fc877b7..bfac36e 100644
--- a/android/Bootstrap/Makefile.shared
+++ b/android/Bootstrap/Makefile.shared
@@ -13,71 +13,16 @@
 # (and iOS), etc. We don't really win anything by having so many layers of
 # configurability on platforms like Android and iOS where apps based on LO
 # code are very much self-contained pre-packaged thingies.
-APP_DATA_PATH=/data/data/$(APP_PACKAGE)
 
-SODEST=libs/$(ANDROID_APP_ABI)
+SODEST=jniLibs/$(ANDROID_APP_ABI)
 OBJLOCAL=obj/local/$(ANDROID_APP_ABI)
 
-APPCOMPATDIR=$(BOOTSTRAPDIR)/../AppCompat-v7
-
-define COPYSO
-       $(error COPYSO should not be used now with DISABLE_DYNLOADING)
-endef
-
-define COPYJAR
-mkdir -p libs && cp $(1) libs
-endef
-
 #
 # Helpful rules ...
 #
 
-#
-# The Android SDK recommends you copy/paste some big -package-resources
-# rule in order to not pack certain kinds of resources. Unfortunately this
-# rule interacts with the rest of the ant code in horrible ways such that
-# upgrading your SDK auto-breaks everything.
-#
-# Horrors below:
-#
-$(BOOTSTRAPDIR)/no-resource-compress.xml : $(ANDROID_SDK_HOME)/tools/ant/build.xml $(BOOTSTRAPDIR)/no-resource-compress-*.xml
-	( \
-	android_sdk_ver=`grep 'Pkg.Revision' $(ANDROID_SDK_HOME)/tools/source.properties | sed 's/^.*=//' | sed 's/\..*//'` ; \
-	sed 's/@ANDROID_PACKAGE_NAME@/$(ANDROID_PACKAGE_NAME)/' < $(BOOTSTRAPDIR)/no-resource-compress-$$android_sdk_ver.xml > $@ ; \
-	if ! test -f $(BOOTSTRAPDIR)/no-resource-compress.xml; then \
-	   echo "Unknown Android SDK version: $$android_sdk_ver"; \
-	   exit 1; \
-	fi \
-	)
-
-android_version_setup : $(BOOTSTRAPDIR)/no-resource-compress.xml
-
-prepare-appcompat:
-	mkdir $(APPCOMPATDIR) 2>/dev/null; true
-	cp -rf $(ANDROID_SDK_HOME)/extras/android/support/v7/appcompat/* $(APPCOMPATDIR)
-	$(ANDROID_SDK_HOME)/tools/android update lib-project --target android-23 --path $(APPCOMPATDIR)
-
-properties:
+local.properties:
 	echo sdk.dir=$(ANDROID_SDK_HOME) >local.properties
-	echo sdk.dir=$(ANDROID_SDK_HOME) >../Bootstrap/local.properties
-	echo "# File needed by ndk-gdb" >jni/Application.mk
-	echo "APP_ABI := $(ANDROID_APP_ABI)" > jni/Application.mk
-	echo "APP_PLATFORM := android-21" >> jni/Application.mk
-
-install:
-	unset JAVA_HOME && $(ANT) debug install
-	@echo
-	@echo 'Run it with "make run"'
-	@echo
-
-uninstall:
-	$(ANDROID_SDK_HOME)/platform-tools/adb uninstall $(APP_PACKAGE)
-
-clean: android_version_setup properties
-	$(ANT) $(if $(VERBOSE)$(verbose),,-quiet) -keep-going clean
-	rm -rf assets libs $(SODEST) $(OBJLOCAL) $(BOOTSTRAPDIR)/no-resource-compress.xml
-	rm -f native-code.cxx
-	rm -rf $(APPCOMPATDIR)
 
 #
 # Build / link the single .so for this app
@@ -107,8 +52,6 @@ $(SODEST)/liblo-native-code.so : $(OBJLOCAL)/liblo-native-code.so
 	$(STRIP) -o $(SODEST)/liblo-native-code.so $(OBJLOCAL)/liblo-native-code.so
 	#to keep some symbols, eg.: $(STRIP) -o $(SODEST)/liblo-native-code.so $(OBJLOCAL)/liblo-native-code.so -w -K 'Java*'
 
-# shrinkme $(STRIP) -o $(SODEST)/liblo-native-code.so $(OBJLOCAL)/liblo-native-code.so
-
 link-so: $(SODEST)/liblo-native-code.so
 
 # If you reinstall an app several times *on the emulator*, even if you
@@ -119,109 +62,30 @@ link-so: $(SODEST)/liblo-native-code.so
 stop-start-cycle:
 	$(ANDROID_SDK_HOME)/platform-tools/adb shell stop && $(ANDROID_SDK_HOME)/platform-tools/adb shell start && sleep 10
 
-copy-stuff:
-# Then "assets". Let the directory structure under assets mimic
-# that under solver for now.
-#
-# Please note that I have no idea what all of this is really necessary and for
-# much of this stuff being copied, no idea whether it makes any sense at all.
-# Much of this is copy-pasted from android/qa/sc/Makefile (where a couple of
-# unit tests for sc are built, and those do seem to mostly work) and
-# android/qa/desktop/Makefile (mmeeks's desktop demo, also works to some
-# extent).
-#
-	mkdir -p assets/lib assets/program/services assets/gz.unpack/program
-	gzip -9 <$(INSTDIR)/$(LIBO_ETC_FOLDER)/types/offapi.rdb >assets/gz.unpack/program/offapi.rdb
-	gzip -9 <$(INSTDIR)/$(LIBO_ETC_FOLDER)/types/oovbaapi.rdb >assets/gz.unpack/program/oovbaapi.rdb
-	gzip -9 <$(INSTDIR)/$(LIBO_URE_MISC_FOLDER)/types.rdb >assets/gz.unpack/program/udkapi.rdb
-# For some reason the vnd.sun.star.expand:$LO_LIB_DIR doesn't seem to work, it expands to empty!?
-	for F in program/services/services program/services; do \
-		sed -e 's!uri="vnd.sun.star.expand:$$LO_LIB_DIR/!uri="file://$$APP_DATA_DIR/lib/!g' <$(INSTDIR)/$$F.rdb >assets/$$F.rdb; \
-	done
-	cp $(if $(exampleDocument),$(exampleDocument),$(SRC_ROOT)/android/default-document/example.odt) assets/example.odt
-	cp $(SRC_ROOT)/readlicense_oo/license/LICENSE assets/license.txt
-	cp $(SRC_ROOT)/readlicense_oo/license/NOTICE assets/notice.txt
-#
-	rm -Rf assets/share # pre-clean it
-	mkdir -p assets/share/config
-	cp -R $(INSTDIR)/share/registry assets/share
-# Filter data is needed by e.g. the drawingML preset shape import.
-	cp -R $(INSTDIR)/share/filter assets/share
-# Make sure the soffice.cfg directory is always created, it's not possible to hit any keys without it.
-	if ! test z$(DISABLE_UI) = zTRUE; then \
-		echo "Copying UI files into the apk"; \
-		cp -R $(INSTDIR)/share/config/soffice.cfg assets/share/config; \
-	else \
-		echo "Skipping UI files"; \
-		mkdir -p assets/share/config/soffice.cfg; \
-		echo > assets/share/config/soffice.cfg/empty; \
-		for F in main.xcd res/registry_en-US.xcd; do \
-			$(SRC_ROOT)/android/mobile-config.py assets/share/registry/$$F assets/share/registry/$$F.new && mv assets/share/registry/$$F.new assets/share/registry/$$F; \
-		done; \
-	fi
-
-	mkdir -p assets/unpack/program
-	echo '[Bootstrap]' > assets/unpack/program/sofficerc
-	echo 'Logo=1' >> assets/unpack/program/sofficerc
-	echo 'NativeProgress=1' >> assets/unpack/program/sofficerc
-	echo 'URE_BOOTSTRAP=file:///assets/program/fundamentalrc' >> assets/unpack/program/sofficerc
-	echo 'HOME=$$APP_DATA_DIR/cache' >> assets/unpack/program/sofficerc
-	echo 'OSL_SOCKET_PATH=$$APP_DATA_DIR/cache' >> assets/unpack/program/sofficerc
-#
-# Set up fundamentalrc
-	echo '[Bootstrap]' > assets/program/fundamentalrc
-	echo 'LO_LIB_DIR=file://$$APP_DATA_DIR/lib/' >> assets/program/fundamentalrc
-	echo 'BRAND_BASE_DIR=file:///assets' >> assets/program/fundamentalrc
-	echo 'CONFIGURATION_LAYERS=xcsxcu:$${BRAND_BASE_DIR}/share/registry res:$${BRAND_BASE_DIR}/share/registry' >> assets/program/fundamentalrc
-	echo 'URE_BIN_DIR=file:///assets/ure/bin/dir/nothing-here/we-can/exec-anyway' >> assets/program/fundamentalrc
-#
-# Set up unorc
-	echo '[Bootstrap]' > assets/program/unorc
-	echo 'URE_INTERNAL_LIB_DIR=file://$$APP_DATA_DIR/lib/' >> assets/program/unorc
-	echo 'UNO_TYPES=file://$$APP_DATA_DIR/program/udkapi.rdb file://$$APP_DATA_DIR/program/offapi.rdb file://$$APP_DATA_DIR/program/oovbaapi.rdb' >> assets/program/unorc
-	echo 'UNO_SERVICES=file:///assets/program/services.rdb file:///assets/program/services/services.rdb' >> assets/program/unorc
-#
-# Set up bootstraprc
-	echo '[Bootstrap]' > assets/program/bootstraprc
-	echo 'InstallMode=<installmode>' >> assets/program/bootstraprc
-	echo 'ProductKey=LibreOffice $(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR)' >> assets/program/bootstraprc
-	echo 'UserInstallation=file://$$APP_DATA_DIR' >> assets/program/bootstraprc
-#
-# Set up versionrc
-	echo '[Version]' > assets/program/versionrc
-	echo 'AllLanguages=en-US' >> assets/program/versionrc
-	echo 'BuildVersion=' >> assets/program/versionrc
-	echo 'buildid=$(shell cd $(SRCDIR) && git log -1 --format=%H)' >> assets/program/versionrc
-	echo 'ReferenceOOoMajorMinor=4.1' >> assets/program/versionrc
-	sed -e 's|@ANDROID_DEBUGGABLE@|$(if $(ENABLE_DEBUG),android:debuggable="true",)|' \
-	    -e 's|@ANDROID_INSTALL_LOCATION@|$(if $(ENABLE_DEBUG),internalOnly,preferExternal)|' \
-	    -e 's|@ANDROID_VERSION_NAME@|$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)$(LIBO_VERSION_SUFFIX)$(LIBO_VERSION_SUFFIX_SUFFIX)/$(shell cd $(SRCDIR) && git log -1 --format=%h)/$(OOO_VENDOR)|' \
-	    -e 's|@ANDROID_VERSION_NUMBER@|$(if $(versionCode),$(versionCode),1)|' \
-	    < AndroidManifest.xml.in > AndroidManifest.xml
-#
-# .res files
-	mkdir -p assets/program/resource
-	cp $(INSTDIR)/$(LIBO_SHARE_RESOURCE_FOLDER)/*en-US.res assets/program/resource
-#
-# Assets that are unpacked at run-time into the app's data directory. These
-# are files read by non-LO code, fontconfig and freetype for now, that doesn't
-# understand "/assets" paths.
-	mkdir -p assets/unpack/etc/fonts
-	cp fonts.conf assets/unpack/etc/fonts
-# $UserInstallation/user/fonts is added to the fontconfig path in
-# vcl/generic/fontmanager/helper.cxx: psp::getFontPath(). UserInstallation is
-# set to the app's data dir above.
-	mkdir -p assets/gz.unpack/user/fonts
-	for F in $(INSTDIR)/share/fonts/truetype/Liberation*.ttf \
-	         $(INSTDIR)/share/fonts/truetype/Caladea-*.ttf \
-	         $(INSTDIR)/share/fonts/truetype/Carlito-*.ttf \
-	         $(INSTDIR)/share/fonts/truetype/Gen*.ttf \
-		 $(INSTDIR)/share/fonts/truetype/opens___.ttf; do \
-		gzip -9 <$$F >assets/gz.unpack/user/fonts/`basename $$F`; \
-	done
-#
-# Then gdbserver and gdb.setup so that we can debug with ndk-gdb.
-#
-	mkdir -p $(SODEST)
-	cp $(ANDROID_NDK_GDBSERVER) $(SODEST)
-	echo set solib-search-path ./obj/local/$(ANDROID_APP_ABI) >$(SODEST)/gdb.setup
+# build-host specific stuff (build paths and the like) to keep build.gradle static
+liboSettings.gradle: $(BUILDDIR)/config_build.mk $(BUILDDIR)/config_host.mk
+	@echo "creating $@"
+	( \
+		echo "// created by Makefile.shared - your changes will be overridden" \
+		&& echo "ext {" \
+		&& echo "    liboSrcRoot         = '$(SRC_ROOT)'" \
+		&& echo "    liboWorkdir         = '$(WORKDIR)'" \
+		&& echo "    liboInstdir         = '$(INSTDIR)'" \
+		&& echo "    liboEtcFolder       = '$(LIBO_ETC_FOLDER)'" \
+		&& echo "    liboUreMiscFolder   = '$(LIBO_URE_MISC_FOLDER)'" \
+		&& echo "    liboSharedResFolder = '$(LIBO_SHARE_RESOURCE_FOLDER)'" \
+		&& echo "    liboUREJavaFolder   = '$(LIBO_URE_SHARE_JAVA_FOLDER)'" \
+		&& echo "    liboShareJavaFolder = '$(LIBO_SHARE_JAVA_FOLDER)'" \
+		&& echo "    liboExampleDocument = '$(if $(exampleDocument),$(exampleDocument),$(SRC_ROOT)/android/default-document/example.odt)'" \
+		&& echo "    liboVersionMajor    = '$(LIBO_VERSION_MAJOR)'" \
+		&& echo "    liboVersionMinor    = '$(LIBO_VERSION_MINOR)'" \
+		&& echo "    liboGitFullCommit   = '$(shell cd $(SRCDIR) && git log -1 --format=%H)'" \
+		&& echo "    liboNdkGdbserver    = '$(ANDROID_NDK_GDBSERVER)'" \
+		&& echo "    liboAndroidAppAbi   = '$(ANDROID_APP_ABI)'" \
+		&& echo "}" \
+		&& echo "android.defaultConfig {" \
+		&& echo "    applicationId '$(ANDROID_PACKAGE_NAME)'" \
+		&& echo "    versionCode project.hasProperty('cmdVersionCode') ? cmdVersionCode.toInteger() : $(if $(versionCode),$(versionCode),1)" \
+		&& echo "    versionName '$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)$(LIBO_VERSION_SUFFIX)$(LIBO_VERSION_SUFFIX_SUFFIX)/$(shell cd $(SRCDIR) && git log -1 --format=%h)/$(OOO_VENDOR)'" \
+		&& echo "}" \
+	) > $@
diff --git a/android/Bootstrap/ant.properties b/android/Bootstrap/ant.properties
deleted file mode 100644
index ee52d86..0000000
--- a/android/Bootstrap/ant.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-#
-# This file must be checked in Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-#  'source.dir' for the location of your java source folder and
-#  'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-#  'key.store' for the location of your keystore and
-#  'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-
diff --git a/android/Bootstrap/build.xml b/android/Bootstrap/build.xml
deleted file mode 100644
index a186d8d..0000000
--- a/android/Bootstrap/build.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="LibreOfficeBootstrap" default="help">
-
-    <!-- The local.properties file is created and updated by the 'android' tool.
-         It contains the path to the SDK. It should *NOT* be checked into
-         Version Control Systems. -->
-    <loadproperties srcFile="local.properties" />
-
-    <!-- The ant.properties file can be created by you. It is only edited by the
-         'android' tool to add properties to it.
-         This is the place to change some Ant specific build properties.
-         Here are some properties you may want to change/update:
-
-         source.dir
-             The name of the source directory. Default is 'src'.
-         out.dir
-             The name of the output directory. Default is 'bin'.
-
-         For other overridable properties, look at the beginning of the rules
-         files in the SDK, at tools/ant/build.xml
-
-         Properties related to the SDK location or the project target should
-         be updated using the 'android' tool with the 'update' action.
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems.
-
-         -->
-    <property file="ant.properties" />
-
-    <!-- The project.properties file is created and updated by the 'android'
-         tool, as well as ADT.
-
-         This contains project specific properties such as project target, and library
-         dependencies. Lower level build properties are stored in ant.properties
-         (or in .classpath for Eclipse projects).
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems. -->
-    <loadproperties srcFile="project.properties" />
-
-    <!-- quick check on sdk.dir -->
-    <fail
-            message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
-            unless="sdk.dir"
-    />
-
-
-<!-- extension targets. Uncomment the ones where you want to do custom work
-     in between standard targets -->
-<!--
-    <target name="-pre-build">
-    </target>
-    <target name="-pre-compile">
-    </target>
-
-    /* This is typically used for code obfuscation.
-       Compiled code location: ${out.classes.absolute.dir}
-       If this is not done in place, override ${out.dex.input.absolute.dir} */
-    <target name="-post-compile">
-    </target>
--->
-
-    <!-- Import the actual build file.
-
-         To customize existing targets, there are two options:
-         - Customize only one target:
-             - copy/paste the target into this file, *before* the
-               <import> task.
-             - customize it to your needs.
-         - Customize the whole content of build.xml
-             - copy/paste the content of the rules files (minus the top node)
-               into this file, replacing the <import> task.
-             - customize to your needs.
-
-         ***********************
-         ****** IMPORTANT ******
-         ***********************
-         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
-         in order to avoid having your file be overridden by tools such as "android update project"
-    -->
-    <!-- version-tag: 1 -->
-    <import file="${sdk.dir}/tools/ant/build.xml" />
-
-</project>
diff --git a/android/Bootstrap/no-resource-compress-20.xml b/android/Bootstrap/no-resource-compress-20.xml
deleted file mode 100644
index dd0fee0..0000000
--- a/android/Bootstrap/no-resource-compress-20.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="clobber_android_rules" default="debug">
-
-    <import file="${sdk.dir}/tools/ant/build.xml" />
-
-<!--
-    This is copy/pasted from ${sdk.dir}/tools/ant/build.xml
-    and tweaked - it needs to match the same SDK version as
-    your build
--->
-
-<!--
-    This file is auto-generated by Bootstrap/Makefile.shared from
-    a versioned .xml file - please edit me there
--->
-
-    <target name="-package-resources" depends="-crunch">
-        <!-- only package resources if *not* a library project -->
-        <do-only-if-not-library elseText="Library project: do not package resources..." >
-            <aapt executable="${aapt}"
-                    command="package"
-                    manifestpackage="@ANDROID_PACKAGE_NAME@"
-                    versioncode="${version.code}"
-                    versionname="${version.name}"
-                    debug="${build.is.packaging.debug}"
-                    manifest="${out.manifest.abs.file}"
-                    assets="${asset.absolute.dir}"
-                    androidjar="${project.target.android.jar}"
-                    apkfolder="${out.absolute.dir}"
-                    nocrunch="${build.packaging.nocrunch}"
-                    resourcefilename="${resource.package.file.name}"
-                    resourcefilter="${aapt.resource.filter}"
-                    libraryResFolderPathRefid="project.library.res.folder.path"
-                    libraryPackagesRefid="project.library.packages"
-                    previousBuildType="${build.last.target}"
-                    buildType="${build.target}"
-                    ignoreAssets="${aapt.ignore.assets}">
-                <res path="${out.res.absolute.dir}" />
-                <res path="${resource.absolute.dir}" />
-                <nocompress/> <!-- forces no compression on any files in assets or res/raw -->
-                <!-- <nocompress extension="xml" /> forces no compression on specific file extensions in assets and res/raw -->
-            </aapt>
-        </do-only-if-not-library>
-    </target>
-</project>
diff --git a/android/Bootstrap/no-resource-compress-21.xml b/android/Bootstrap/no-resource-compress-21.xml
deleted file mode 100644
index c06f839..0000000
--- a/android/Bootstrap/no-resource-compress-21.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="clobber_android_rules" default="debug">
-
-    <import file="${sdk.dir}/tools/ant/build.xml" />
-
-<!--
-    This is copy/pasted from ${sdk.dir}/tools/ant/build.xml
-    and tweaked - it needs to match the same SDK version as
-    your build
--->
-
-<!--
-    This file is auto-generated by Bootstrap/Makefile.shared from
-    a versioned .xml file - please edit me there
--->
-
-    <target name="-package-resources" depends="-crunch">
-        <!-- only package resources if *not* a library project -->
-        <do-only-if-not-library elseText="Library project: do not package resources..." >
-            <aapt executable="${aapt}"
-                    command="package"
-                    manifestpackage="@ANDROID_PACKAGE_NAME@"
-                    versioncode="${version.code}"
-                    versionname="${version.name}"
-                    debug="${build.is.packaging.debug}"
-                    manifest="${out.manifest.abs.file}"
-                    assets="${asset.absolute.dir}"
-                    androidjar="${project.target.android.jar}"
-                    apkfolder="${out.absolute.dir}"
-                    nocrunch="${build.packaging.nocrunch}"
-                    resourcefilename="${resource.package.file.name}"
-                    resourcefilter="${aapt.resource.filter}"
-                    libraryResFolderPathRefid="project.library.res.folder.path"
-                    libraryPackagesRefid="project.library.packages"
-                    libraryRFileRefid="project.library.bin.r.file.path"
-                    previousBuildType="${build.last.target}"
-                    buildType="${build.target}"
-                    ignoreAssets="${aapt.ignore.assets}">
-                <res path="${out.res.absolute.dir}" />
-                <res path="${resource.absolute.dir}" />
-                <nocompress/> <!-- forces no compression on any files in assets or res/raw -->
-                <!-- <nocompress extension="xml" /> forces no compression on specific file extensions in assets and res/raw -->
-            </aapt>
-        </do-only-if-not-library>
-    </target>
-</project>
diff --git a/android/Bootstrap/no-resource-compress-22.xml b/android/Bootstrap/no-resource-compress-22.xml
deleted file mode 100644
index c06f839..0000000
--- a/android/Bootstrap/no-resource-compress-22.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="clobber_android_rules" default="debug">
-
-    <import file="${sdk.dir}/tools/ant/build.xml" />
-
-<!--
-    This is copy/pasted from ${sdk.dir}/tools/ant/build.xml
-    and tweaked - it needs to match the same SDK version as
-    your build
--->
-
-<!--
-    This file is auto-generated by Bootstrap/Makefile.shared from
-    a versioned .xml file - please edit me there
--->
-
-    <target name="-package-resources" depends="-crunch">
-        <!-- only package resources if *not* a library project -->
-        <do-only-if-not-library elseText="Library project: do not package resources..." >
-            <aapt executable="${aapt}"
-                    command="package"
-                    manifestpackage="@ANDROID_PACKAGE_NAME@"
-                    versioncode="${version.code}"
-                    versionname="${version.name}"
-                    debug="${build.is.packaging.debug}"
-                    manifest="${out.manifest.abs.file}"
-                    assets="${asset.absolute.dir}"
-                    androidjar="${project.target.android.jar}"
-                    apkfolder="${out.absolute.dir}"
-                    nocrunch="${build.packaging.nocrunch}"
-                    resourcefilename="${resource.package.file.name}"
-                    resourcefilter="${aapt.resource.filter}"
-                    libraryResFolderPathRefid="project.library.res.folder.path"
-                    libraryPackagesRefid="project.library.packages"
-                    libraryRFileRefid="project.library.bin.r.file.path"
-                    previousBuildType="${build.last.target}"
-                    buildType="${build.target}"
-                    ignoreAssets="${aapt.ignore.assets}">
-                <res path="${out.res.absolute.dir}" />
-                <res path="${resource.absolute.dir}" />
-                <nocompress/> <!-- forces no compression on any files in assets or res/raw -->
-                <!-- <nocompress extension="xml" /> forces no compression on specific file extensions in assets and res/raw -->
-            </aapt>
-        </do-only-if-not-library>
-    </target>
-</project>
diff --git a/android/Bootstrap/no-resource-compress-23.xml b/android/Bootstrap/no-resource-compress-23.xml
deleted file mode 100644
index c06f839..0000000
--- a/android/Bootstrap/no-resource-compress-23.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="clobber_android_rules" default="debug">
-
-    <import file="${sdk.dir}/tools/ant/build.xml" />
-
-<!--
-    This is copy/pasted from ${sdk.dir}/tools/ant/build.xml
-    and tweaked - it needs to match the same SDK version as
-    your build
--->
-
-<!--
-    This file is auto-generated by Bootstrap/Makefile.shared from
-    a versioned .xml file - please edit me there
--->
-
-    <target name="-package-resources" depends="-crunch">
-        <!-- only package resources if *not* a library project -->
-        <do-only-if-not-library elseText="Library project: do not package resources..." >
-            <aapt executable="${aapt}"
-                    command="package"
-                    manifestpackage="@ANDROID_PACKAGE_NAME@"
-                    versioncode="${version.code}"
-                    versionname="${version.name}"
-                    debug="${build.is.packaging.debug}"
-                    manifest="${out.manifest.abs.file}"
-                    assets="${asset.absolute.dir}"
-                    androidjar="${project.target.android.jar}"
-                    apkfolder="${out.absolute.dir}"
-                    nocrunch="${build.packaging.nocrunch}"
-                    resourcefilename="${resource.package.file.name}"
-                    resourcefilter="${aapt.resource.filter}"
-                    libraryResFolderPathRefid="project.library.res.folder.path"
-                    libraryPackagesRefid="project.library.packages"
-                    libraryRFileRefid="project.library.bin.r.file.path"
-                    previousBuildType="${build.last.target}"
-                    buildType="${build.target}"
-                    ignoreAssets="${aapt.ignore.assets}">
-                <res path="${out.res.absolute.dir}" />
-                <res path="${resource.absolute.dir}" />
-                <nocompress/> <!-- forces no compression on any files in assets or res/raw -->
-                <!-- <nocompress extension="xml" /> forces no compression on specific file extensions in assets and res/raw -->
-            </aapt>
-        </do-only-if-not-library>
-    </target>
-</project>
diff --git a/android/Bootstrap/no-resource-compress-24.xml b/android/Bootstrap/no-resource-compress-24.xml
deleted file mode 100644
index c06f839..0000000
--- a/android/Bootstrap/no-resource-compress-24.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="clobber_android_rules" default="debug">
-
-    <import file="${sdk.dir}/tools/ant/build.xml" />
-
-<!--
-    This is copy/pasted from ${sdk.dir}/tools/ant/build.xml
-    and tweaked - it needs to match the same SDK version as
-    your build
--->
-
-<!--
-    This file is auto-generated by Bootstrap/Makefile.shared from
-    a versioned .xml file - please edit me there
--->
-
-    <target name="-package-resources" depends="-crunch">
-        <!-- only package resources if *not* a library project -->
-        <do-only-if-not-library elseText="Library project: do not package resources..." >
-            <aapt executable="${aapt}"
-                    command="package"
-                    manifestpackage="@ANDROID_PACKAGE_NAME@"
-                    versioncode="${version.code}"
-                    versionname="${version.name}"
-                    debug="${build.is.packaging.debug}"
-                    manifest="${out.manifest.abs.file}"
-                    assets="${asset.absolute.dir}"
-                    androidjar="${project.target.android.jar}"
-                    apkfolder="${out.absolute.dir}"
-                    nocrunch="${build.packaging.nocrunch}"
-                    resourcefilename="${resource.package.file.name}"
-                    resourcefilter="${aapt.resource.filter}"
-                    libraryResFolderPathRefid="project.library.res.folder.path"
-                    libraryPackagesRefid="project.library.packages"
-                    libraryRFileRefid="project.library.bin.r.file.path"
-                    previousBuildType="${build.last.target}"
-                    buildType="${build.target}"
-                    ignoreAssets="${aapt.ignore.assets}">
-                <res path="${out.res.absolute.dir}" />
-                <res path="${resource.absolute.dir}" />
-                <nocompress/> <!-- forces no compression on any files in assets or res/raw -->
-                <!-- <nocompress extension="xml" /> forces no compression on specific file extensions in assets and res/raw -->
-            </aapt>
-        </do-only-if-not-library>
-    </target>
-</project>
diff --git a/android/Bootstrap/project.properties b/android/Bootstrap/project.properties
deleted file mode 100644
index cb55769..0000000
--- a/android/Bootstrap/project.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system use,
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-
-android.library=true
-# Project target.
-target=android-23
diff --git a/android/CustomTarget_lo_android.mk b/android/CustomTarget_lo_android.mk
index 37f3012..05d6d43 100644
--- a/android/CustomTarget_lo_android.mk
+++ b/android/CustomTarget_lo_android.mk
@@ -20,7 +20,7 @@ $(loandroid3_DIR)/done : $(call gb_Postprocess_get_target,AllModulesButInstsetNa
 # still looks for the .apk, and we want fresh daily builds to be uploaded.
 # Us "foo" instead of the old INPATH
 	mkdir -p $(BUILDDIR)/instsetoo_native/foo/bin; \
-	cp $(SRCDIR)/android/source/bin/*-debug.apk $(BUILDDIR)/instsetoo_native/foo/bin
+	cp $(SRCDIR)/android/source/build/outputs/apk/*-debug.apk $(BUILDDIR)/instsetoo_native/foo/bin
 
 $(call gb_CustomTarget_get_clean_target,android/loandroid3) :
 	$(call gb_Output_announce,$(subst $(WORKDIR)/Clean/,,$@),$(false),MAK,2)
diff --git a/android/Makefile b/android/Makefile
index 3d7763a..5d877d4 100644
--- a/android/Makefile
+++ b/android/Makefile
@@ -23,8 +23,8 @@ release-apk: build
 	rm -f $(SIGNED_APK)
 
 	# the actual signing
-	jarsigner --verbose -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ~/.keystore $(BUILDDIR)/android/source/bin/LibreOfficeViewer-release-unsigned.apk $(key)
-	$(ANDROID_SDK_HOME)/build-tools/*/zipalign -v 4 $(BUILDDIR)/android/source/bin/LibreOfficeViewer-release-unsigned.apk $(SIGNED_APK)
+	jarsigner --verbose -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ~/.keystore $(BUILDDIR)/android/source/build/outputs/apk/LibreOfficeViewer-strippedUI-release-unsigned.apk $(key)
+	$(ANDROID_SDK_HOME)/build-tools/*/zipalign -v 4 $(BUILDDIR)/android/source/build/outputs/apk/LibreOfficeViewer-strippedUI-release-unsigned.apk $(SIGNED_APK)
 
 	@echo
 	@echo "Resulting signed apk: $(SIGNED_APK)"
diff --git a/android/source/AndroidManifest.xml.in b/android/source/AndroidManifest.xml
similarity index 97%
rename from android/source/AndroidManifest.xml.in
rename to android/source/AndroidManifest.xml
index b459182..f15e66f 100644
--- a/android/source/AndroidManifest.xml.in
+++ b/android/source/AndroidManifest.xml
@@ -1,9 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="org.libreoffice"
-    android:installLocation="@ANDROID_INSTALL_LOCATION@"
-    android:versionCode="@ANDROID_VERSION_NUMBER@"
-    android:versionName="@ANDROID_VERSION_NAME@">
+    android:installLocation="${installLocation}">
 
     <!-- App requires OpenGL ES 2.0 -->
     <uses-feature android:glEsVersion="0x00020000" android:required="true" />
@@ -12,7 +10,6 @@
     <uses-permission android:name="android.permission.INTERNET" />
 
     <application
-        @ANDROID_DEBUGGABLE@
         android:allowBackup="true"
         android:icon="@drawable/main"
         android:label="@string/app_name"
diff --git a/android/source/Makefile b/android/source/Makefile
index bd1e576..6f2f968 100644
--- a/android/source/Makefile
+++ b/android/source/Makefile
@@ -5,11 +5,7 @@ endif
 
 # The default target just builds.
 
-all: build-ant
-
-# The package of this app
-# The setting from configure (ANDROID_PACKAGE_NAME) is applied in later stages.
-APP_PACKAGE=org.libreoffice
+all: build-gradle
 
 DISABLE_UI=TRUE
 BOOTSTRAPDIR=../Bootstrap
@@ -18,27 +14,25 @@ include $(BOOTSTRAPDIR)/Makefile.shared
 native-code.cxx: $(SRCDIR)/solenv/bin/native-code.py
 	$< -j -g core -g writer -g calc -g draw -g edit > $@
 
-build-ant: android_version_setup copy-stuff prepare-appcompat link-so properties
-#
-# Copy jar files we need
-#
-	for F in java_uno \
-		 juh \
-		 jurt \
-		 ridl \
-		 unoloader; do \
-	    $(call COPYJAR,$(INSTDIR)/$(LIBO_URE_SHARE_JAVA_FOLDER)/$${F}.jar); \
-	done
-	for F in unoil; do \
-	    $(call COPYJAR,$(INSTDIR)/$(LIBO_SHARE_JAVA_FOLDER)/$${F}.jar); \
-	done
-	#ownCloud lib dependency
-	$(call COPYJAR,$(WORKDIR)/UnpackedTarball/owncloud_android_lib/bin/owncloud-android-library.jar)
-#
-	unset JAVA_HOME && $(ANT) $(if $(VERBOSE)$(verbose),,-quiet) $(if $(ENABLE_RELEASE_BUILD),release,debug)
+install:
+	./gradlew $(if $(verbose),--info) $(if $(versionCode),-PcmdVersionCode=$(versionCode)) install$(if $(DISABLE_UI),StrippedUI,FullUI)Debug
+	@echo
+	@echo 'Run it with "make run"'
+	@echo
+
+uninstall:
+	$(ANDROID_SDK_HOME)/platform-tools/adb uninstall $(ANDROID_PACKAGE_NAME)
+
+clean:
+	rm -rf assets assets_fullUI assets_strippedUI jniLibs jniLibs_debug $(OBJLOCAL)
+	rm -f native-code.cxx
+	rm -f liboSettings.gradle
+
+build-gradle: liboSettings.gradle local.properties link-so
+	./gradlew $(if $(verbose),--info) $(if $(versionCode),-PcmdVersionCode=$(versionCode)) assemble$(if $(DISABLE_UI),StrippedUI,FullUI)$(if $(ENABLE_RELEASE_BUILD),Release,Debug)
 
 run:
-	adb shell am start -n $(APP_PACKAGE)/.ui.LibreOfficeUIActivity
+	$(ANDROID_SDK_HOME)/platform-tools/adb shell am start -n $(ANDROID_PACKAGE_NAME)/.ui.LibreOfficeUIActivity
 
 debugrun:
 	$(SYSBASE)/../../../ndk-gdb --start
diff --git a/android/source/build.gradle b/android/source/build.gradle
new file mode 100644
index 0000000..8e2355c
--- /dev/null
+++ b/android/source/build.gradle
@@ -0,0 +1,273 @@
+project.ext.set("archivesBaseName", "LibreOfficeViewer")
+//build-time dependencies - android plugin for gradle
+buildscript {
+    repositories {
+        jcenter()
+    }
+    dependencies {
+        classpath 'com.android.tools.build:gradle:1.3.1'
+    }
+}
+
+apply plugin: 'com.android.application'
+// buildhost settings - paths and the like
+apply from: 'liboSettings.gradle'
+
+// compile-time dependencies
+dependencies {
+    compile fileTree(dir: "${liboInstdir}/${liboUREJavaFolder}", include: [
+            "java_uno.jar",
+            "juh.jar",
+            "jurt.jar",
+            "ridl.jar",
+            "unoloader.jar"
+    ])
+    compile files("${liboInstdir}/${liboShareJavaFolder}/unoil.jar")
+    compile files("${liboWorkdir}/UnpackedTarball/owncloud_android_lib/bin/owncloud-android-library.jar")
+    compile 'com.android.support:support-v4:23.0.1'
+    compile 'com.android.support:appcompat-v7:23.0.1'
+}
+
+android {
+    compileSdkVersion 23
+    buildToolsVersion "23.0.1"
+    compileOptions {
+        // silence some java-language features hints
+        sourceCompatibility 6
+    }
+    // uses non-conventional source layout, so need to reconfigure accordingly
+    // ToDo move to conventional layout, so stuff can be stripped down.
+    sourceSets {
+        main.manifest.srcFile 'AndroidManifest.xml'
+        main.assets.srcDirs = ['assets']
+        main.res.srcDirs = ['res']
+        main.java.srcDirs = ['../Bootstrap/src', 'src/java']
+        main.jniLibs.srcDirs = ['jniLibs']
+        main.jni.srcDirs = [] // don't attempt to build native-lib via gradle
+        // gdbserver stuff from separate dir
+        debug.jniLibs.srcDirs "jniLibs_debug"
+        // the configuration data that might be stripped or not
+        fullUI.assets.srcDirs 'assets_fullUI'
+        strippedUI.assets.srcDirs 'assets_strippedUI'
+    }
+    // defaults for Manifest
+    defaultConfig {
+        minSdkVersion 14
+        targetSdkVersion 23
+        manifestPlaceholders = [installLocation: "preferExternal"]
+    }
+    buildTypes {
+        debug {
+            // make android studio happy...
+            jniDebuggable true
+            // would work just fine with external, but setting emulator up is a little more work
+            manifestPlaceholders = [installLocation: "internalOnly"]
+        }
+    }
+    productFlavors {
+        strippedUI
+        fullUI
+    }
+}
+
+/* remark inherited from makefile:
+Then "assets". Let the directory structure under assets mimic
+that under solver for now.
+
+Please note that I have no idea what all of this is really necessary and for
+much of this stuff being copied, no idea whether it makes any sense at all.
+Much of this is copy-pasted from android/qa/sc/Makefile (where a couple of
+unit tests for sc are built, and those do seem to mostly work) and
+android/qa/desktop/Makefile (mmeeks's desktop demo, also works to some
+extent)
+ */
+
+// Assets that are unpacked at run-time into the app's data directory. These
+// are files read by non-LO code, fontconfig and freetype for now, that doesn't
+// understand "/assets" paths.
+task copyUnpackAssets(type: Copy) {
+    description "copies assets that need to be extracted on the device"
+    into 'assets/unpack'
+    into('program') {
+        from("${liboInstdir}/${liboEtcFolder}/types") {
+            includes = [
+                    "offapi.rdb",
+                    "oovbaapi.rdb"
+            ]
+        }
+        from("${liboInstdir}/${liboUreMiscFolder}") {
+            includes = ["types.rdb"]
+            rename 'types.rdb', 'udkapi.rdb'
+        }
+    }
+    into('user/fonts') {
+        from "${liboInstdir}/share/fonts/truetype"
+        // Note: restrict list of fonts due to size considerations - no technical reason anymore
+        // ToDo: fonts would be good candidate for using Expansion Files instead
+        includes = [
+                "Liberation*.ttf",
+                "Caladea-*.ttf",
+                "Carlito-*.ttf",
+                "Gen*.ttf",
+                "opens___.ttf"
+        ]
+    }
+    into('etc/fonts') {
+        from "./"
+        includes = ['fonts.conf']
+        filter {
+            String line ->
+                line.replaceAll(
+                        '@@APPLICATION_ID@@', new String("${android.defaultConfig.applicationId}")
+                )
+        }
+    }
+}
+
+task copyAssets(type: Copy) {
+    description "copies assets that can be accessed within the installed apk"
+    into 'assets'
+    from("${liboSrcRoot}/readlicense_oo/license/") {
+        includes = ["LICENSE", "NOTICE"]
+        rename "LICENSE", "license.txt"
+        rename "NOTICE", "notice.txt"
+    }
+    from("${liboExampleDocument}") {
+        rename ".*", "example.odt"
+    }
+    into('program') {
+        from "${liboInstdir}/program"
+        includes = ['services.rdb', 'services/services.rdb']
+
+        into('resource') {
+            from "${liboInstdir}/${liboSharedResFolder}"
+            includes = ['*en-US.res']
+        }
+    }
+    into('share') {
+        from "${liboInstdir}/share"
+        // Filter data is needed by e.g. the drawingML preset shape import.
+        includes = ['registry/**', 'filter/**']
+        // those two get processed by mobile-config.py
+        excludes = ['registry/main.xcd', 'registry/res/registry_en-US.xcd']
+    }
+}
+
+task createFullConfig(type: Copy) {
+    // grab dir to clear whole hierarchy on clean target
+    outputs.dir "assets_fullUI"
+    into 'assets_fullUI/share/config/soffice.cfg'
+    from "${liboInstdir}/share/config/soffice.cfg"
+}
+
+task createStrippedConfig {
+    def preserveDir = file("assets_strippedUI/share/share/config/soffice.cfg/empty")
+    outputs.dir "assets_strippedUI"
+    outputs.dir "assets_strippedUI/share/registry/res"
+    outputs.file preserveDir
+
+    doLast {
+        file('assets_strippedUI/share/registry/res').mkdirs()
+        file("assets_strippedUI/share/share/config/soffice.cfg").mkdirs()
+        // just empty file
+        preserveDir.text = ""
+    }
+}
+
+
+task createStrippedConfigMain(type: Exec) {
+    dependsOn 'createStrippedConfig'
+    inputs.files "${liboInstdir}/share/registry/main.xcd", "${liboSrcRoot}/android/mobile-config.py"
+    outputs.file "assets_strippedUI/share/registry/main.xcd"
+    executable "${liboSrcRoot}/android/mobile-config.py"
+    args = ["${liboInstdir}/share/registry/main.xcd", "assets_strippedUI/share/registry/main.xcd"]
+}
+
+task createStrippedConfigRegistry(type: Exec) {
+    dependsOn 'createStrippedConfig'
+    inputs.files "${liboInstdir}/share/registry/res/registry_en-US.xcd", "${liboSrcRoot}/android/mobile-config.py"
+    outputs.file "assets_strippedUI/share/registry/res/registry_en-US.xcd"
+    executable "${liboSrcRoot}/android/mobile-config.py"
+    args = ["${liboInstdir}/share/registry/res/registry_en-US.xcd", "assets_strippedUI/share/registry/res/registry_en-US.xcd"]
+    doFirst {
+        file('assets_strippedUI/share/registry/res').mkdirs()
+    }
+}
+
+task copyNdkDebugServer(type: Copy) {
+    description "copies gdbserver into and creates gdb.setup in the debug-type only native directory"
+    inputs.file "liboSettings.gradle"
+    def gdbsetup = file("jniLibs_debug/${liboAndroidAppAbi}/gdb.setup")
+    outputs.file gdbsetup
+    outputs.dir 'jniLibs_debug' // own the directory, so it is removed on this task's clean
+    into "jniLibs_debug/${liboAndroidAppAbi}"
+    from "${liboNdkGdbserver}"
+    doLast {
+        gdbsetup.text = "set solib-search-path ./obj/local/${liboAndroidAppAbi}"
+    }
+}
+
+task createRCfiles {
+    inputs.file "liboSettings.gradle"
+    dependsOn copyUnpackAssets, copyAssets
+    def sofficerc     = file('assets/unpack/program/sofficerc')
+    def fundamentalrc = file('assets/program/fundamentalrc')
+    def bootstraprc   = file('assets/program/bootstraprc')
+    def unorc         = file('assets/program/unorc')
+    def versionrc     = file('assets/program/versionrc')
+
+    outputs.files sofficerc, fundamentalrc, unorc, bootstraprc, versionrc
+
+    doLast {
+        sofficerc.text = '''\
+            [Bootstrap]
+            Logo=1
+            NativeProgress=1
+            URE_BOOTSTRAP=file:///assets/program/fundamentalrc
+            HOME=$APP_DATA_DIR/cache
+            OSL_SOCKET_PATH=$APP_DATA_DIR/cache
+            '''.stripIndent()
+
+        fundamentalrc.text =  '''\
+            [Bootstrap]
+            LO_LIB_DIR=file://$APP_DATA_DIR/lib/
+            BRAND_BASE_DIR=file:///assets
+            CONFIGURATION_LAYERS=xcsxcu:${BRAND_BASE_DIR}/share/registry res:${BRAND_BASE_DIR}/share/registry
+            URE_BIN_DIR=file:///assets/ure/bin/dir/nothing-here/we-can/exec-anyway
+            '''.stripIndent()
+
+        bootstraprc.text =  '''\
+            [Bootstrap]
+            InstallMode=<installmode>
+            ProductKey=LibreOffice '''+ "${liboVersionMajor}.${liboVersionMinor}" + '''
+            UserInstallation=file://$APP_DATA_DIR
+            '''.stripIndent()
+
+        unorc.text = '''\
+            [Bootstrap]
+            URE_INTERNAL_LIB_DIR=file://$APP_DATA_DIR/lib/
+            UNO_TYPES=file://$APP_DATA_DIR/program/udkapi.rdb file://$APP_DATA_DIR/program/offapi.rdb file://$APP_DATA_DIR/program/oovbaapi.rdb
+            UNO_SERVICES=file:///assets/program/services.rdb file:///assets/program/services/services.rdb
+            '''.stripIndent()
+
+        versionrc.text = '''\
+            [Version]
+            AllLanguages=en-US
+            BuildVersion=
+            buildid=''' + "${liboGitFullCommit}" + '''
+            ReferenceOOoMajorMinor=4.1
+            '''.stripIndent()
+    }
+}
+
+// creating the UI stuff is cheap, don't bother only applying it for the flavor..
+preBuild.dependsOn 'createRCfiles',
+        'createStrippedConfigMain',
+        'createStrippedConfigRegistry',
+        'createFullConfig',
+        'copyNdkDebugServer'
+

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list