Topic-icon Building PokerTH for Android

24 Sep 2019 08:42 #44246 by rajnikharge
rajnikharge created the topic: Building PokerTH for Android
QT 5 for android: (
Android NDK toolset r13b (
JDK v7+
ant 1.8+
CMOSS is a set of libraries built for android.
To get CMOSS and build them:
$ git clone
$ cd cmoss/build-droid/
$ ./ [NDK_DIRECTORY] ## (eg: ./ ~/android/android-ndk-r13b)
This process could lauch some errors. It's possible one has to manually modify some variables in Good luck ;)
Important note: ndk version should be r13b as the cmoss libs build best with it.
If don't have wine installed ( there are two options:
Install it ;)
Get protoc for windows:, and extract it in PokerTH source directory. Then, rename protoc-2.4.1.exe to protoc.exe. Note that build for protobuf shall fail, but it's not a big deal. Just ignore it.
oSome steps...
Check your protoc version ($ protoc --version)
Edit and replace [export PROTOBUF_VERSION="2.4.1"] for [export PROTOBUF_VERSION="your protoc version"]
Edit and replace for in ./configure command
Edit and remove "wine" from android entry
Depending on your device, might be usefull to edit and replace:
o[export ARM_TARGET="armv5"] for [export ARM_TARGET="armv7"]. Make sure your android device is able to run with armv-7 architecture before switch. If you are not sure, just leave "armv5". See later note in compilation process (*)
o[export ANDROID_API_LEVEL="9"] for [export ANDROID_API_LEVEL="<NDK_VERSION>"], where <NDK_VERSION> is your ANDROID NDK version.
Get code
Same as version for Linux
set ANDROID_NDK_ROOT variable to its directory. E.g.:
$ export ANDROID_NDK_ROOT=~/android/android-ndk-r13b
Run qmake for Android and make. E.g:
$ ~/Qt/Qt5.7.1/5.7/android_armv7/bin/qmake CONFIG+="client gui_800x480" PREFIX+="[CMOSS_DIRECTORY]/bin/droid" -spec android-g++
$ make
Once finished, ./ must be created

If Qt for Android is different than 5.7.1, you have to correct some files, replacing [#include "QtGui/5.7.1/..."] for the aproppiate version you donwloaded, in following files:


(*) If you modified ARM architecture when compiling CMOSS (from armv5 to armv7), before running qmake and make you have to replace in from:

LIBPATH += $${PREFIX}/lib/armv5
LIB_DIRS = $${PREFIX}/lib/armv5


LIBPATH += $${PREFIX}/lib/armv7
LIB_DIRS = $${PREFIX}/lib/armv7

Get Android SDK
Download "" (or newer) and uncompress in any folder
Get SDK:
$ cd tools_r25.2.3-linux/tools
$ ./android
A GUI application will be launched to select tools and versions to be installed. Install, at least:
From Tools: Android SDK Tools; Android SDK Build-tools; Android SDK Platform-tools
Full Android SDK v5.1.1 (API 22) or newer
Build APK
First, edit file to set the appropriate SDK location, for instance:
"sdk": "~/android/tools_r25.2.3-linux",
Set JAVA_HOME and append javac to PATH
$ export JAVA_HOME=/usr/lib/jvm/java-8-oracle
$ export PATH=$JAVA_HOME/bin:$PATH
Build APK:
$ make install INSTALL_ROOT=./bin/
$ ~/Qt/Qt5.7.1/5.7/android_armv7/bin/androiddeployqt --input \
--output ./bin --deployment bundled --android-platform android-22 --jdk /usr/lib/jvm/java-8-oracle --ant /usr/bin/ant
APK should be created in ./bin/bin/QtApp-debug.apk

source from

Please Log in or Create an account to join the conversation.

Champions of

PokerTH - live

The PokerTH spectator tool.

Member Login

NOTE! This site uses cookies and similar technologies.
Cookies make it easier for us to provide you with our services. With the usage of our services you permit us to use cookies.
More information

We use cookies to personalize content and ads to offer features for social media and analyze the number of hits on our website. We also provide information about your use of our website to our partner for social media, advertising and analysis on.