Skip to content

Cross Compiling BioGears for Android

Steven A White edited this page Jul 15, 2022 · 22 revisions

Cross compilation of Native C++ Libraries is an intermediate to expert skill that requires knowledge of the workings of compilers, linker, and system tool-chains in general. Android is a multi platform OS that can be deployed on over 5 processor architectures which further complicates the generation of documentation on how to generate Android builds. This documentation focuses on the generation of aarch64 builds fro targeting the majority of Android Mobile Phones. Targeting this platform requires familiarity with the Android Native Development Kit (NDK) and integration in to an APK requires familiarity of the Android Software Development Kit (SDK). Incorporating Bio Gears in to your own Android project is outside of scope of this documentation and we refer you to the following resources for learning how to make Android projects before attempting incorporation of a large project like BioGears in to your own project.

  1. Android NDK EXAMPLES
  2. Android Application Development

Instead this documentation focuses on the creation of Architecture appropriate binaries for libBioGears and its dependencies using the toolchain and compilers provided by the Android NDK. This documentation will call out specific versions of the Android NDK that were tested against the instructions. While other versions of the NDK should be able to compile BioGears for Android correctly, they are untested and may require additional instructional as compiler versions and header storage with in the NDK change over time. Additionally, methods of using CMake with the NDK are improving with each release and may be different then the NDKs referenced in these instructions. That said the NDK versions referenced in these instructions should provide compatible binaries for all Android phones up to 2022.

Warning: This documentation is intended for those failure with concepts of C++ and Mobile development. It assumes you are capable of setting up your own build environments and makes assumptions about your ability to manage your personal environment variables. This documentation is open source and does accept contributions to improve clarity

Requirements

  • Android NDK - android-ndk-r17c - Last GCC Release / Last gnustl release - June 2018
  • Android SDK - API Level 29 / 30 - 2019

Meta Build Scripts

CMakeLists.txt

For this documentation I will be referring to the BioGears MetaBuild CMakeLists.txt. The purpose of this file is to simplify gathering of all the required third party libraries needed to make a cross compilation. The script is attached to this documentation

Clone this wiki locally