The libraries and tools necessary for APEX are built in the
tools/android-prepare-api.sh
and tools/android-build.sh
scripts. These
scripts were made for Linux, while it’s possible to build on Windows no scripts
or documentation are provided.
Other than the requirements found in compiling_instructions you will need the following:
Installation automated by the tools/android-prepare-api.sh
script.
We compile OpenSSL as a shared archive for Android. Special care needs to be taken to avoid loading the system libraries, which are OpenSSL 1.0. See https://doc.qt.io/qt-5/android-openssl-support.html for more information about how to build OpenSSL for android.
Autotools, CMake, and AutoGen are needed for the tools/android-prepare-api.sh
script.
No specific Ubuntu version is needed. The scripts should work if all the dependencies compile with the build tools available on your platform, any platform with recent versions of Autotools and CMake should do. The scripts were tested with ubuntu 18.
To crosscompile all the dependencies the tools/android-prepare-api.sh
script
is provided.
Most dependencies can be build with cmake and the cmake toolchain provided by the NDK. Other dependencies not using cmake need to be build with instructions described here and here. Since NDK r17 care should be taken not to include symbols from libgcc.a
and libunwind.a
to avoid problems with stack unwinding after an exception is thrown. This is described here in detail.
Libc++ is used as the STL. Libc++ expects type information for exception handling and dynamic casts. Providing a key funcion ensures type information. This is an extra requirement for C++ code that should run on Android.
Once all the dependencies are compiled run the tools/android-build.sh
script. Run it with the --help
parameter for all options. Be sure to
provide the --build-apk
parameter to build an actual apk.
The release version can be installed with F-Droid. Install F-Droid and add https://exporl.med.kuleuven.be/apex-fdroid/repo as a repository. Simply install from there.
For information on how to register the device with the apex-study interface you can consult the documentation on studies.
The debug version which you build yourself can be installed with the Android debugging bridge (adb).
To build the release version on a build server, first follow the building
steps above. tools/android-prepare-api.sh
can easily take 15
minutes, so make sure the it doesn’t have to be called each build.
To build a release version you’ll need to supply the following parameters to
tools/android-build.sh
:
--release
: for release.
--ks
: path to the keystore containing the key which the apk will be signed
with. This key is stored in a JKS keystore.
--ks-pass
: this is the keystore password.
APKs need to be signed so the user can verify that any next version is issued by us. The public key certificate included with the APK is self-signed. The JKS keystore and password should be kept in a safe location. Only the Android build server should have access to these.
To publish the apk to the fdroid repo, simply copy it to the repository folder and call the deploy script, see the release guide for more information.