Build Garlic-Player for Android

Builds for Android do not require any further libs like the desktop variants. Garlic-player will use the integrated Android WebView and Media-API. Therefore, garlic-player supports the same codecs and browser features as the underlying Android.

Annoyed Android Developer

Mandatory Knowledge

You should be familiar with C++, Java, Qt, and qt creator on your operating system. Furthermore, you need to know how to install JDK or OpenJDK (Linux) Android SDK and NDK to work with qt creator.

Requirements

Android primarily uses Java for app development. As garlic-player is in C++. In applications that require native languages like C or C++, the NDK provides the tools needed to embed native code written in these languages. The NDK provides libraries that give C++ code direct access to hardware components, such as the CPU and sensors, which can be essential for certain types of apps.

C++ must be written for more than one ABI (Application Binary Interface) in Android development because different Android devices use different processor architectures (like ARM, ARM64, x86). Each architecture has its ABI, which defines how low-level operations like function calls and data handling are performed. To ensure that a C++ application runs correctly and efficiently on various devices, it must be compiled for each of the relevant ABI.

Until now, garlic versions could use only one ABI with Qt5.12. We created the binaries for armv7, as this is suitable for the most Android devices. From now on (Qt15.5) it is possible to pack more than one ABI in an APK (x86_64 arm64-v8a armeabi-v7a x86). As a result, the binary builds are much bigger and the process is more complex.

  • >= Qt5.15.8

    The code is in a “transitional period” ;) and I prepare it for the migration to Qt6. You can also use lower Qt5.15.x versions but then take a look at the deprecated qmake in QML player and use the deprecated Android brandings

    If you want to use Qt5.12.12, take the last stable source from v0.6.0 tree

  • Android SDK
  • Android NDK. For >=Qt5.15.8 use 22.1.7171670. Older versions based on 21.3.6528147.
  • OpenSSL 1.1.1.
Take a look at Build Qt for Android for more details.

Build Order

The build process Garlic-player for Android requires this order:

  1. zlib
  2. quazip
  3. garlic-lib
  4. player-c2qml

If you would rather not build garlic-player for all ABI's open the corresponding pro-files, find the line “ANDROID_ABIS=x86_64 arm64-v8a armeabi-v7a x86" and remove the ABI you do not need.

Compiling of player-2qml will create an unsigned debug APK and the run process deploy it to your device or virtualization.

Automation and Signed Release APK

If you want to make a signed APK, check out the Android build script in the script directory.