Qt Creator Manual

Connecting Android Devices

You can connect Android devices to the development PC to build, run, debug, and analyze applications on them from Qt Creator.

If you have a tool chain for building applications for Android devices installed on the development PC, you can add it to Qt Creator. You can then add a kit with the Android device type, the tool chain, and the Qt version for Android, to build and run applications on Android devices.

Requirements

To use Qt Creator to develop Qt applications for Android, you need the following:

  • OpenJDK Java Development Kit

    To check whether you have OpenJDK installed, enter the following command:

    java -version

    To install OpenJDK, enter the following command:

    sudo apt-get install openjdk-6-jdk

  • Apache Ant 1.8.0, or later

    To check the Ant version, enter the following command on the command line:

    ant -version

  • Necessitas SDK

Configuring Connections

The Qt for Android SDK automatically sets the paths to the required software in Qt Creator.

To configure connections between Qt Creator and Android devices:

  1. Select Tools > Options > Build & Run > Qt Versions > Add to add Qt for Android.
  2. In the qmake location field, add the qmake path from the Qt for Android SDK (/opt/necessitas/Android/<qtversion>/bin/qmake by default).
  3. Select Tools > Options > Android to view and edit paths to the required software.

    "Android options"

  4. Select Tools > Options > Build & Run > Qt Versions and build the GDB Helper to make the debugging output for Qt specific constructs clean and easy to read.
  5. To build the GDB Helper, select Qt for Android, select Details in the Helpers section, and then select Build in the GDB Helper field.
  6. Select Start Android AVD Manager to create Android virtual devices (AVD) that enable you emulate device hardware and software on the Android Emulator.
  7. To specify information for the Android manifest file, select Projects > Run, and then select Details to view the Package configurations. For more information about the options you have, see Specifying Run Settings for Android Devices.
  8. To specify settings for deploying applications to Android, select Details to view the Deploy configurations. For more information about the options you have, see Deploying Applications to Android Devices.

Debugging on Android Devices

Android devices support debugging multi-thread applications in version 2.2.1 and later. If you use AVD, select Android 2.3, or later. For more information, see the Android documentation.

In addition, debugging is supported at android-10 API level, or higher. In the run settings for the project, in the Android target SDK field, select android-10, or higher. For more information about Android API levels, see What is API Level?.

Note: Select a debug build configuration to build the application for debugging.