Development/BuildingForAndroid
TDF LibreOffice Document Liberation Project Community Blogs Weblate Nextcloud Redmine Ask LibreOffice Donate
This manual is for building LibreOffice for Android. If this does match your platform, please refer to the development page on Wiki to find the correct build instructions.
LibreOffice Versions
This manual is written for the latest git master.
Dependencies
Installing the Android SDK
One of the simplest way to obtain Android SDK is to use the Android Command Line Tools and use the sdkmanager
to install an SDK.
After extracting the command line tools in ~/Android/Sdk
, you can to to that folder and invoke:
Then, use this command to download platform SDK, NDK and other needed packages:
cd ~/Android/Sdk
./cmdline-tools/bin/sdkmanager --sdk_root=$PWD --install 'build-tools;34.0.0' 'platforms;android-34' 'tools' 'ndk;27.2.12479018'
It is also possible to download SDK and NDK from the Android studio website instead of the above method.
Cloning and building
The build instructions are very similar to the normal How To Build instructions.
When you have the NDK and SDK, clone the git repo:
git clone git://gerrit.libreoffice.org/core libreoffice
cd libreoffice
Create your autogen.input
, so that it looks like:
# ARM Android
--with-distro=LibreOfficeAndroid
# or Android x86 ( preferable if using an AVD Emulator )
--with-distro=LibreOfficeAndroidX86
--with-android-sdk=$HOME/Android/Sdk
--with-android-ndk=$HOME/Android/Sdk/ndk/27.2.12479018
Configure (and install packages as needed) and build
./autogen.sh
make
How to run it
The apk file for Android will be available in instsetoo_native/foo/bin
folder. You can install the .apk to the emulator or a physical device.
Using an IDE for Android Viewer development
An integrated development environment (IDE) helps developers to have a better coding experience. For Android development, you can refer to the wiki article Development/How to debug with android to understand how to use IDEs for debugging the LibreOffice Android Viewer using an emulator.
More information
More information about the development can be found in: