fcs59w
Last Updated: February 25, 2016
·
4.594K
· marianofino

Set-up Qt for Android dev on Ubuntu

Brief explanation on how to set up your development environment to develop Android apps on Ubuntu using Qt.

Installing and configuring Qt

  1. Download and install the latest Qt.
  2. Install necessary extra packages for Qt:
    • For 64-bit machines: sudo apt-get install libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386
    • For the emulator: sudo apt-get install libsdl1.2debian:i386

Android dev environment

  1. Download the latest Android SDK and uncompress it.
  2. Edit your ~/.bashrc file by adding these line at the end: export PATH=$PATH:/path/to/android-sdk-linux/platform-tools:/path/to/android-sdk-linux/tools
  3. You should logout and login again to update the PATH variable.
  4. In a terminal, run android and install the suggested packages.
  5. Download the latest NDK, and execute it: chmod +x android-ndk-version.bin && ./android-ndk-version.bin
  6. Install ant from repositories: sudo apt-get install ant
  7. Install java development kit (in this example openjdk): sudo apt-get install openjdk-7-jdk.

Debugging

The instructions are for debugging on physical devices.

  1. Set up your device for debugging (just the Enabling On-device Developer Options section)
  2. To make sure you don't deal with permissions, you can start your adb server as root mode. For this, go to path/to/android-sdk/platform-tools and run ./adb kill-server && sudo ./adb start-server
  3. Plug-in your mobile device, authorize it and test your environment following this tutorial.