Building for Android

To develop applications for Android, you need development tools provided by the Android SDK from Google, and (optionally) a C/C++ toolchain provided by the Android NDK.

Note: Qbs does not yet support the Kotlin programming language.

Creating Android Application Packages

On Android, applications are distributed in a specially structured type of ZIP package called an APK. The following files should be created and bundled into an APK:

  • Android assets.
  • Android resource files.
  • AndroidManifest.xml, which provides meta-information about your application.
  • Compiled Java code, which serves as the entry point into your application and that automatically executes the native code in your application (if there is any).
  • Shared libraries containing native code.

You can use the AndroidApk item to build application packages for Android. The properties of the AndroidApk item specify the locations of the APK source files.

The AndroidApk item has a dependency on the Android.sdk module, which contains the properties and rules to create Android application packages from source files.

You can use the DynamicLibrary item to build native Android libraries that are bundled into the APK. The qbs.architectures property specifies the architectures to build for, with the default value armv7a.

The DynamicLibrary item has a dependency on the Android.ndk module, and contains the properties and rules to create native libraries.