Topic-icon Building PokerTH for Android

More
24 Sep 2019 08:42 #44246 by rajnikharge
rajnikharge created the topic: Building PokerTH for Android
Requirements
QT 5 for android: (https://www.qt.io/download-open-source/#section-2)
Android NDK toolset r13b (https://developer.android.com/ndk/downloads/index.html)
JDK v7+
ant 1.8+
CMOSS
CMOSS is a set of libraries built for android.
To get CMOSS and build them:
$ git clone https://github.com/doitux/cmoss.git
$ cd cmoss/build-droid/
$ ./build-all.sh [NDK_DIRECTORY] ## (eg: ./build-all.sh ~/android/android-ndk-r13b)
Remarks:
This process could lauch some errors. It's possible one has to manually modify some variables in build-all.sh. Good luck ;)
Important note: ndk version should be r13b as the cmoss libs build best with it.
If don't have wine installed (https://www.winehq.org/) there are two options:
oSteps:
Install it ;)
Get protoc for windows: https://github.com/google/protobuf/releases/download/v2.4.1/protoc-2.4.1-win32.zip, 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 build-all.sh and replace [export PROTOBUF_VERSION="2.4.1"] for [export PROTOBUF_VERSION="your protoc version"]
Edit build-protobuf.sh and replace for in ./configure command
Edit pokerth-protocol.pro and remove "wine" from android entry
Depending on your device, might be usefull to edit build-all.sh 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
Compilation
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++ pokerth.pro
$ make
Once finished, ./libpokerth.so must be created
Remarks:

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:

o./src/gui/qt/aboutpokerth/aboutpokerthimpl.cpp
o./src/gui/qt/gametable/gametableimpl.cpp
o./src/gui/qt/startwindow/startwindowimpl.cpp

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

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

to

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

Get Android SDK
Download "https://dl.google.com/android/repository/tools_r25.2.3-linux.zip" (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 android-libpokerth.so-deployment-settings.json 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 android-libpokerth.so-deployment-settings.json \
--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 https://docsbay.net/building-pokerth-for-android

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

Champions of

PokerTH - live

The PokerTH spectator tool.

Member Login

 advert
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.
http://www.google.com/intl/de/policies/privacy/partners/