site  contact  subhomenews

Creating Android app in QtCreator

August 16, 2015 — BarryK
Here are instructions to compile Qt to be used by QtCreator to build Android apps:

Yeah well, it wasn't that simple for me. This is what I ended up doing:
Android Studio: SDK Manager: installed APIs 10, 11, 16, 18 (note: api-11 is flagged as obsolete)

# export ANDROID_SDK_ROOT='/root/Android/Sdk'
# export ANDROID_NDK_ROOT='/opt/android/ndk-api15-armv7'
# export PATH="${PATH}:/opt/android/ndk-api15-armv7/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86/arm-linux-androideabi/bin"
# ./configure -android-sdk /root/Android/Sdk -no-directfb -no-pulseaudio -L /usr/X11R7/lib -I /usr/X11R7/include -no-sse2 -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -opensource -confirm-license -prefix /opt/qt5a -nomake examples -R /usr/X11R7/lib -skip qtwebengine -android-ndk /opt/android/ndk-api15-armv7 -android-ndk-platform android-15 -android-ndk-host linux-x86 -android-toolchain-version 4.9 -xplatform android-g++ -platform linux-g++ -nomake tests -skip qttranslations -skip qtwebkit -skip qtserialport -skip qtwebkit-examples -no-warnings-are-errors -force-pkg-config -no-xcb -no-gstreamer -no-pkg-config -sysroot /opt/android/ndk-api15-armv7/platforms/android-15/arch-arm
# make
# make install

...the "X11R7" bits are probably not required. Nor the exported variables.

I created a simple app in QtCreator, and it compiled, and build a .apk file.

However, having a problem with the emulator.

Tags: linux