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. You can also allow Qt Creator to automatically configure the kit.
The Android Debug Bridge (adb) command line tool is integrated to Qt Creator to enable you to deploy applications to connected Android devices, to run the applications on them, and to read logs from them. It includes a client and server that run on the development host and a daemon that runs on the emulator or device.
To use Qt Creator to develop Qt applications for Android, you need the following:
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
To check the Ant version, enter the following command on the command line:
ant -version
The Necessitas SDK automatically sets the paths to the required software in Qt Creator, but you need to add the Qt version. Qt Creator can then create the necessary kits for you.
To configure connections between Qt Creator and Android devices:
You must download and install the latest Android NDK and SDK, and update the SDK to get the API and tools packages needed for development. In addition, you must install Qt for Android from the Qt 5.1 packages.
For more information, see Android.
To configure connections between Qt Creator and Android devices:
Debugging is enabled in different ways on different Android devices. Look for USB Debugging under Developer Options. On some devices Developer Options is hidden and becomes visible when you tap the Build number field in Settings > About several times.
To run your application on the Android Emulator, you must create Android virtual devices (AVD). Select Tools > Options > Android > Add. If you run an application without a device connected to the development PC and without an AVD specified, Qt Creator asks you to add an AVD.
To manage AVDs, select Start Android AVD Manager.
Note: The Android Emulator has a bug that prevents it from starting on some systems. If the Android Emulator does not start, you can try starting it manually by running the emulator-arm command from the command line.
Qt Creator is integrated with the GDB and GDB server that are delivered with the Necessitas SDK. It provides GDB with Python support that enables Qt Creator to display custom Qt types, such as QString, QObject, and so on.
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.