2019-03-19 10:00:38 -05:00
|
|
|
The development of this Android app has to be done on Linux, it's currently not possible to
|
|
|
|
build the native parts on Windows.
|
2019-02-11 12:02:46 -06:00
|
|
|
|
2019-03-19 10:00:38 -05:00
|
|
|
* Compile LibreOffice master for Android.
|
|
|
|
|
|
|
|
Do this in the folder where you cloned the LibreOffice core (e.g master-android).
|
|
|
|
|
|
|
|
Create an autogen.input file:
|
2019-02-11 12:02:46 -06:00
|
|
|
|
|
|
|
--build=x86_64-unknown-linux-gnu
|
|
|
|
--with-android-ndk=/home/$USER/Android/Sdk/ndk-bundle
|
|
|
|
--with-android-sdk=/home/$USER/Android/Sdk
|
|
|
|
--with-distro=LibreOfficeAndroid
|
|
|
|
--enable-sal-log
|
|
|
|
|
2019-03-19 10:00:38 -05:00
|
|
|
Run ./autogen.sh && make
|
2019-02-11 12:02:46 -06:00
|
|
|
|
|
|
|
* Build the POCO for Android
|
|
|
|
|
2019-03-19 10:00:38 -05:00
|
|
|
# clone the poco repository in the same folder where LibreOffice core and online folders are placed.
|
|
|
|
git clone https://github.com/pocoproject/poco poco-android
|
|
|
|
cd poco-android
|
|
|
|
|
2019-02-12 06:24:52 -06:00
|
|
|
# use the 1.9.1 branch
|
|
|
|
git checkout -b poco-1.9.1 origin/poco-1.9.1
|
2019-02-11 12:02:46 -06:00
|
|
|
|
|
|
|
# configure
|
|
|
|
./configure --config=Android --no-samples --no-tests --minimal
|
|
|
|
|
|
|
|
# make it
|
2019-02-12 06:24:52 -06:00
|
|
|
PATH="$PATH":~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin make -j8 ANDROID_ABI=armeabi-v7a CC=armv7a-linux-androideabi21-clang CXX=armv7a-linux-androideabi21-clang++ SYSLIBS=-static-libstdc++
|
2019-02-11 12:02:46 -06:00
|
|
|
|
|
|
|
# install it to /opt/poco-android
|
2019-02-12 06:24:52 -06:00
|
|
|
PATH="$PATH":~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin make -j8 ANDROID_ABI=armeabi-v7a CC=armv7a-linux-androideabi21-clang CXX=armv7a-linux-androideabi21-clang++ SYSLIBS=-static-libstdc++ install INSTALLDIR=/opt/poco-android
|
2019-02-11 12:02:46 -06:00
|
|
|
|
2019-11-08 17:29:18 -06:00
|
|
|
* 64bit POCO for Android
|
|
|
|
|
|
|
|
# checkout the 1.9.1 in a different location and apply the following patch:
|
|
|
|
--- a/build/config/Android
|
|
|
|
+++ b/build/config/Android
|
|
|
|
@@ -21,6 +21,11 @@ TOOL = arm-linux-androideabi
|
|
|
|
ARCHFLAGS = -march=armv7-a -mfloat-abi=softfp
|
|
|
|
LINKFLAGS = -Wl,--fix-cortex-a8
|
|
|
|
else
|
|
|
|
+ifeq ($(ANDROID_ABI),arm64-v8a)
|
|
|
|
+TOOL = aarch64-linux-android
|
|
|
|
+#ARCHFLAGS = -march=armv7-a -mfloat-abi=softfp
|
|
|
|
+#LINKFLAGS = -Wl,--fix-cortex-a8
|
|
|
|
+else
|
|
|
|
ifeq ($(ANDROID_ABI),x86)
|
|
|
|
TOOL = i686-linux-android
|
|
|
|
ARCHFLAGS = -march=i686 -msse3 -mstackrealign -mfpmath=sse
|
|
|
|
@@ -29,6 +34,7 @@ $(error Invalid ABI specified in ANDROID_ABI)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
+endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# Define Tools
|
|
|
|
|
|
|
|
# configure as above and make it:
|
|
|
|
PATH="$PATH":~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin make -j8 ANDROID_ABI=arm64-v8a CC=aarch64-linux-android21-clang CXX=aarch64-linux-android21-clang++ SYSLIBS=-static-libstdc++
|
|
|
|
|
|
|
|
# install
|
|
|
|
PATH="$PATH":~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin make -j8 ANDROID_ABI=arm64-v8a CC=aarch64-linux-android21-clang CXX=aarch64-linux-android21-clang++ SYSLIBS=-static-libstdc++ install INSTALLDIR=/opt/poco-android-64bit
|
|
|
|
|
2019-03-19 10:00:38 -05:00
|
|
|
* Configure the online.git (eg. in online-android folder)
|
|
|
|
|
|
|
|
Don't forget to change --with-lo-builddir in the following:
|
2019-02-11 12:02:46 -06:00
|
|
|
|
2019-02-13 05:09:36 -06:00
|
|
|
./autogen.sh && ./configure CC=~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang CXX=~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang++ --host=arm-linux-androideabi --enable-androidapp --with-lo-builddir=/local/libreoffice/master-android --with-poco-includes=/opt/poco-android/include --with-poco-libs=/opt/poco-android/lib --disable-setcap --enable-silent-rules --enable-debug
|
2019-02-12 03:13:16 -06:00
|
|
|
|
2019-03-19 10:00:38 -05:00
|
|
|
* Build the JavaScript, HTML and CSS files also in the online-android folder
|
2019-02-13 06:22:25 -06:00
|
|
|
|
|
|
|
# just run 'make'
|
|
|
|
make
|
|
|
|
|
|
|
|
* Build the actual app
|
2019-02-12 03:13:16 -06:00
|
|
|
|
|
|
|
+ Start Android Studio
|
|
|
|
+ Open this 'android' subdir as a project
|
|
|
|
+ Build from Android Studio (Build -> Make Project)
|
2019-03-20 09:46:11 -05:00
|
|
|
|
2019-11-25 14:34:21 -06:00
|
|
|
== Building 32bit + 64bit combined .apk ==
|
|
|
|
|
|
|
|
+ you need to build both a 32bit (armeabi-v7a) and 64bit (arm64-v8a) core
|
|
|
|
+ you need to build both a 32bit and 64bit POCO
|
|
|
|
+ and then provide paths to both to the ./configure, separated by a colon ':',
|
|
|
|
like:
|
|
|
|
|
|
|
|
--with-lo-builddir=/local/libreoffice/master-android-release:/local/libreoffice/master-android-release-64bit \
|
|
|
|
--with-poco-includes=/opt/poco-android/include:/opt/poco-android-64bit/include \
|
|
|
|
--with-poco-libs=/opt/poco-android/lib:/opt/poco-android-64bit/lib \
|
|
|
|
|
2019-04-10 05:38:55 -05:00
|
|
|
== Debugging ==
|
|
|
|
|
|
|
|
To debug the native code in Android Studio, you need the debugging symbols and
|
|
|
|
to setup lldb to actually read & use them.
|
|
|
|
|
|
|
|
* Add debugging symbols for the modules you are interested in
|
|
|
|
|
|
|
|
To autogen.input, add something like:
|
|
|
|
|
|
|
|
--enable-symbols="vcl/ desktop/ sal/ svx/ framework/ sfx2/ tools/ cppu/ cppuhelper/ filter/ comphelper/ Library_sw Library_swd Library_swui"
|
|
|
|
|
|
|
|
clean the appropriate modules, like
|
|
|
|
|
|
|
|
make vcl.clean desktop.clean sal.clean svx.clean framework.clean sfx2.clean tools.clean cppu.clean cppuhelper.clean filter.clean comphelper.clean sw.clean
|
|
|
|
|
|
|
|
and rebuild using 'make'.
|
|
|
|
|
|
|
|
* Add android/source/obj/local/armeabi-v7a from core.git as a Symbol Directory
|
|
|
|
|
|
|
|
In Android Studio, choose Run -> Debug... -> Edit Configurations...
|
|
|
|
|
|
|
|
There go to the Android App -> app, choose the Debugger tab, and:
|
|
|
|
|
|
|
|
Debug type: Auto (or Dual)
|
|
|
|
|
|
|
|
Symbol Directories: here add the full path, like
|
|
|
|
|
|
|
|
/local/libreoffice/master-android/android/source/obj/local/armeabi-v7a
|
|
|
|
|
|
|
|
This path contains the non-stripped version of the liblo-native-code.so, and
|
|
|
|
the debugger will read the symbols from that one (even if the APK contains
|
2019-12-11 16:52:55 -06:00
|
|
|
the stripped version). *NB* ensure that this is before any internal source
|
|
|
|
directories - since the internal source contains stripped native code.
|
2019-04-10 05:38:55 -05:00
|
|
|
|
|
|
|
[Alternatively you can add the following to your ~/.lldbinit instead:
|
|
|
|
|
|
|
|
settings set target.inline-breakpoint-strategy always
|
|
|
|
settings append target.exec-search-paths /local/libreoffice/master-android/android/source/obj/local/armeabi-v7a
|
|
|
|
]
|
|
|
|
|
2019-10-29 00:58:15 -05:00
|
|
|
* To use pretty printers for types like OUString, add the following to your
|
|
|
|
~/.lldbinit:
|
|
|
|
|
|
|
|
command script import '/local/libreoffice/master-android/solenv/lldb/libreoffice/LO.py'
|
|
|
|
|
|
|
|
From now on, you will be able to debug directly in the Android Studio
|
2019-04-10 05:38:55 -05:00
|
|
|
debugger. Happy debugging!
|
|
|
|
|
2019-12-11 16:52:55 -06:00
|
|
|
Note: to re-buld your app with a newly compiled libnative-lo code - it is
|
|
|
|
|
2019-03-20 09:46:11 -05:00
|
|
|
== Tip: How to speed up your core.git build ==
|
|
|
|
|
|
|
|
If you use icecream for parallel building, you can use it for
|
|
|
|
cross-compilation too.
|
|
|
|
|
|
|
|
# first generate a tarball with the toolchain (once)
|
|
|
|
icecc-create-env ~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang ~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang++
|
|
|
|
|
|
|
|
And add it and the paths to the compiler as the first things to the
|
|
|
|
autogen.input:
|
|
|
|
|
|
|
|
CC=icecc [here copy what the output of ./autogen.sh without icecream said for C compiler]
|
|
|
|
CXX=icecc [here copy what the output of ./autogen.sh without icecream said for C++ compiler]
|
|
|
|
ICECC_VERSION=/path/to/the/tarball/generated/above/955ceb546ceb7a5715bf0223ddd788fe.tar.gz
|
|
|
|
--with-parallelism=[amount of cpu threads in your icecream farm]
|
|
|
|
--enable-icecream
|
|
|
|
[...the original autogen.input...]
|
|
|
|
|
|
|
|
So the result will look something like this:
|
|
|
|
|
|
|
|
CC=icecc /home/$USER/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon -Wl,--fix-cortex-a8 -gcc-toolchain /home/$USER/Android/Sdk/ndk-bundle/to>
|
|
|
|
CXX=icecc /home/$USER/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon -Wl,--fix-cortex-a8 -gcc-toolchain /home/$USER/Android/Sdk/ndk-bundle>
|
|
|
|
ICECC_VERSION=/local/libreoffice/android/955ceb546ceb7a5715bf0223ddd788fe.tar.gz
|
|
|
|
--with-parallelism=25
|
|
|
|
--enable-icecream
|
|
|
|
--build=x86_64-unknown-linux-gnu
|
|
|
|
--with-android-ndk=/home/$USER/Android/Sdk/ndk-bundle
|
|
|
|
--with-android-sdk=/home/$USER/Android/Sdk
|
|
|
|
--with-distro=LibreOfficeAndroid
|
|
|
|
--enable-sal-log
|