QtOnAndroid

Deployment

The Android Operating System | | Requirements

Google provides a native development kit, the so called NDK. It contains a full native C++ tool chain to cross-compile and deploy native programs on Android. But of course, the powerful Android Java class hierarchy is not readily available on that path, so that an apparently simple task like loading an image can become a cumbersome experience even for the experienced C++ programmer.

So how do we load a JPEG image, if we do not have a JPEG library around?

We need to deploy third-party libraries like the JPEG library by ourselves. Here we have two options:

  • Cross-compile and package the library by hand.
    • While this is of course possible, it is not easily achieved, so this is only an option for professional developers who want to squeeze the optimum performance out of their device for computational intense tasks.
  • Use a third-party SDK, which automates the deployment of common C++ libraries for us.
    • The SDK may pose additional restrictions on the deployed shared libraries.

We opt for the second case and rely on Qt as a third-party C++ SDK to manage the deployment of native libraries and applications. Qt features an integrated SDK for the Android platform - the Qt Creator.

An example of an Android app developed with C++ and Qt is “trackz”. It is available at the Google Play store from here:


The Android Operating System | | Requirements

Options: