August 15th 2014, Qt Mobile Development Environment
← August 2nd 2014 Qt and Android | ● | August 18th 2014 Qt Creator and Android →
Now comes the real fun: Porting the ssl transmission client to Android using Qt 5.3 Mobile.
We start off according to the recommendations of Bogdan Vatra, that is we set up a Linux box with Qt 5.3, like so:
Habitually, I’d like to use my favorite development platform, which is a MacBook Pro Core2 Duo, to code for Android as well, but due to my bad experiences with MacOS X (as explained in the Necessitas blog) I’m not going through that misery again and use Linux as main platform right away. I choose Debian-based Ubuntu 14.04 LTS 64bit.
1) Install Ant and OpenJDK 6
sudo apt-get install ant openjdk-6-jdk
2) Install Ubuntu 32bit compatibility libraries
On a 64-bit system some Android tools require the 32-bit compatibility libraries to be installed, in particular the 32bit version of the std c++ library and zlib:
sudo apt-get install libstdc++6:i386 zlib1g:1386
3) Install Qt 5.3.1 for Linux 64-bit with Android support
On http://qt-project.org/downloads choose the following offline installer:
- Qt 5.3.1 for Android (Linux 64-bit, 513 MB)
In the download directory:
- chmod +x *.run && sudo ./qt-opensource-linux-x64-android-5.3.1.run
Installs Qt for Android in
- /opt/Qt-5.3.1
4) Download the Android SDK
On http://developer.android.com/sdk/index.html choose “GET THE SDK FOR AN EXISTING IDE” and download the “SDK Tools Only” for “Linux 32 & 64-bit”:
- android-sdk_r23.0.2-linux.tgz
5) Install the Android API SDK
After unpacking the Android SDK,
tar zxvf android-sdk*.tgz
run the
android-sdk-linux/tools/android
tool and choose Android API-13 SDK Platform (or any higher version). You also must install Android SDK Platform-tools and Android SDK Build-tools. Minimum required versions are:
- Android SDK Tools 22.3
- Android SDK Platform-tools 19
- Android SDK Build-tools 19
- Android 3.2 (API 13) SDK Platform
6) Download the Android NDK
On http://developer.android.com/tools/sdk/ndk/index.html download the Linux 64bit NDK for 32bit platforms:
- android-ndk32-r10-linux-x86_64.tar.bz2
7) Extract the Android API NDK
tar jxvf android-ndk*.tar.bz2
8) Set the USB permissions to connect with a real Android device.
Please check Android http://developer.android.com/tools/device.html on this matter.
In order to make sure you’ve set the USB permission correctly, first enable USB debugging on your device, then plug it on your computer and check the output of the following command:
android-sdk-linux/platform-tools/adb devices
I have a LG L7 II (LG-P710) with Android 4.1.2. After enabling “USB Debugging” I get the following device list:
> platform-tools/adb devices List of devices attached LGOTMS13478381 device
← August 2nd 2014 Qt and Android | ● | August 18th 2014 Qt Creator and Android →