Warning, /education/kstars/README.android is written in an unsupported language. File is not indexed.
0001 Prerequisites (verified on Kubuntu 18.04.3):
0002 - Build kstars from source according to https://indilib.org/forum/general/210-howto-building-latest-libindi-ekos.html
0003 - Install Android SDK
0004 - Download and install NDK version android-ndk-r17c.
0005 - Install JDK java-8-openjdk-amd64:
0006 sudo apt-get install openjdk-8-jdk
0007 - Install Qt open source for Android (newest version 5.13.1) under your home directory to be writable.
0008 - After installation of Qt, enter the correct paths to the NDK, JDK and SDK in Tools>Options>Devices>Android and make sure Qt shows no warnings regarding these paths.
0009 - Qt does not work with the newest SDK Tools, you must use v25 as suggested here:
0010 https://stackoverflow.com/questions/42754878/qt-creator-wont-list-any-available-android-build-sdks/42811774#42811774
0011
0012 Basically, download https://dl.google.com/android/repository/tools_r25.2.5-linux.zip and replace the ANDROID_SDK_DIR/tools directory,
0013 or just use the Android SDK download tool to use this version.
0014 - Some tools are needed for the compilation: sudo apt-get install dos2unix ccache subversion ant libconfig-yaml-perl
0015
0016 Edit /etc/environment and add the following environmental variables before building:
0017 PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:$ANT_HOME/bin"
0018 JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"
0019 QT_ANDROID="/$HOME/Qt/5.13.1/android_armv7"
0020 CMAKE_ANDROID_NDK="/$HOME/Android/Sdk/ndk/android-ndk-r17c"
0021 ANDROID_NDK="/$HOME/Android/Sdk/ndk/android-ndk-r17c"
0022 ANDROID_SDK_ROOT="/$HOME/Android/Sdk"
0023 ANDROID_API_LEVEL=17
0024 ANDROID_PLATFORM=17
0025 KSTARS_ROOT="/$HOME/Projects/kstars"
0026 ANT_HOME="/usr/share/ant"
0027
0028 If you want to generate signed release package set the following variables:
0029 export ANDROID_KEYSTORE=your_keystore_file
0030 export ANDROID_KEYSTORE_ALIAS=your_keystore_alias
0031 export KSTARS_ROOT=KStars Path (e.g. /$HOME/Projects/kstars)
0032
0033 Configure git (if you haven't done this already):
0034 git config --global user.email "you@example.com"
0035 git config --global user.name "Your Name"
0036
0037 Make a build directory in a separate location form source (e.g. /$HOME/Projects/build/kstars-android):
0038 - Run build_kf5.sh and verify that the script builds everything without any problem.
0039 NOTE: Ki18n often fails to build the first time, but it should succeeds when you rebuild kf5 again.
0040
0041 $KSTARS_ROOT/packaging/android/build_kf5.sh
0042
0043 Configure out-of-source build (MinSizeRel build type is recommended for Android):
0044 cmake -B. -H$KSTARS_ROOT -DBUILD_KSTARS_LITE=ON -DCMAKE_TOOLCHAIN_FILE=$CMAKE_ANDROID_NDK/build/cmake/android.toolchain.cmake \
0045 -DEIGEN3_INCLUDE_DIR=/usr/include/eigen3/ -DCMAKE_INSTALL_PREFIX=$(pwd)/android/export -DCMAKE_BUILD_TYPE=MinSizeRel \
0046 -DECM_DIR=/usr/share/ECM/cmake/ -DCMAKE_PREFIX_PATH=$QT_ANDROID \
0047 -DCMAKE_AR=${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar
0048
0049 Compile:
0050 make -j4
0051
0052 Download and convert the translations:
0053 make convert_translations_to_android
0054
0055 Install:
0056 make -j4 install
0057
0058 Generate the Android debug package:
0059 make create-apk-debug-kstars
0060
0061 Install the Android debug package to your phone:
0062 make install-apk-debug-kstars
0063
0064 Generate the Android release package:
0065 make create-apk-release-kstars
0066
0067 To sign a release package:
0068 make sign-apk-kstars