diff --git a/README-Android.asciidoc b/README-Android.asciidoc index 085d50ade..7c781dda9 100644 --- a/README-Android.asciidoc +++ b/README-Android.asciidoc @@ -1,15 +1,13 @@ Compile Retroshare for Android ============================== -== Introduction - Compiling an application for Android is not as easy as one would imagine, expecially one like RetroShare that has a big codebase and is not well -documented. -This document is aimed to empower the reader so she can hopefully succed or at -least have a significant help in compiling her own RetroShare APK package +documented. This document is aimed to empower the reader so she can hopefully +succed or at least have a significant help in compiling her own RetroShare APK installable on Android. + == Preparing The Environement First of all setup your Qt for Android development environement following the @@ -21,7 +19,7 @@ on your Android phone Qt for Android examples. But RetroShare is not as simple to compile as those examples. The good news is that Android NDK ships all the necessary to build a custom toolchain that is suitable to build RetroShare. -In order to build the toolchain with needed library RetroShare provides the +In order to build the toolchain with needed libraries RetroShare provides the +android-prepare-toolchain.sh+ script; before you execute it you should define some variables the script cannot determine in an easy and reliable manner by itself in your terminal. @@ -33,7 +31,7 @@ export ANDROID_NDK_PATH="/opt/android-ndk/" ## The path where your fresh compiled toolchain will be installed, make sure ## the parent exists -export NDK_TOOLCHAIN_PATH="/home/$(whoami)/Development/android-toolchains/retroshare-android/" +export NDK_TOOLCHAIN_PATH="${HOME}/Builds/android-toolchains/retroshare-android/" ## The CPU architecture of the Android device you want to target export ANDROID_NDK_ARCH="arm" diff --git a/android-prepare-toolchain.sh b/android-prepare-toolchain.sh index a0e37a054..d89e071e2 100755 --- a/android-prepare-toolchain.sh +++ b/android-prepare-toolchain.sh @@ -5,7 +5,7 @@ [ -z ${ANDROID_NDK_ARCH+x} ] && export ANDROID_NDK_ARCH="arm" [ -z ${ANDROID_NDK_ABI_VER+x} ] && export ANDROID_NDK_ABI_VER="4.9" [ -z ${ANDROID_PLATFORM_VER+x} ] && export ANDROID_PLATFORM_VER="18" -[ -z ${NDK_TOOLCHAIN_PATH+x} ] && export NDK_TOOLCHAIN_PATH="/home/$(whoami)/Development/android-toolchains/retroshare-android-${ANDROID_PLATFORM_VER}-${ANDROID_NDK_ARCH}-abi${ANDROID_NDK_ABI_VER}/" +[ -z ${NDK_TOOLCHAIN_PATH+x} ] && export NDK_TOOLCHAIN_PATH="${HOME}/Builds/android-toolchains/retroshare-android-${ANDROID_PLATFORM_VER}-${ANDROID_NDK_ARCH}-abi${ANDROID_NDK_ABI_VER}/" [ -z ${HOST_NUM_CPU+x} ] && export HOST_NUM_CPU=4 runDir="$(pwd)" diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index d96e7dc7f..a5241abba 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -916,7 +916,7 @@ test_bitdht { ################################# Android ##################################### android-g++ { -## ifaddrs is missing on Android add them don't use the one from +## ifaddrs is missing on Android to add them don't use the one from ## https://github.com/morristech/android-ifaddrs ## because they crash, use QNetworkInterface from Qt instead CONFIG *= qt diff --git a/libretroshare/src/rsserver/rsaccounts.cc b/libretroshare/src/rsserver/rsaccounts.cc index 0f0a6ac94..6bd36b04d 100644 --- a/libretroshare/src/rsserver/rsaccounts.cc +++ b/libretroshare/src/rsserver/rsaccounts.cc @@ -803,7 +803,8 @@ static bool checkAccount(std::string accountdir, AccountDetails &account,std::ma /* Use RetroShare's exe dir */ dataDirectory = "."; - +#elif defined(ANDROID) + dataDirectory = defaultBaseDirectory()+"/usr/share/retroshare"; #elif defined(DATA_DIR) dataDirectory = DATA_DIR; // For all other OS the data directory must be set in libretroshare.pro diff --git a/retroshare-qml-app/src/android/gradle.properties b/retroshare-qml-app/src/android/gradle.properties index 6915cd803..47ab4e463 100644 --- a/retroshare-qml-app/src/android/gradle.properties +++ b/retroshare-qml-app/src/android/gradle.properties @@ -6,4 +6,4 @@ androidBuildToolsVersion=24.0.1 androidCompileSdkVersion=23 buildDir=.build -qt5AndroidDir=/opt/Qt5.8.0/5.8/android_armv7/src/android/java +qt5AndroidDir=/opt/Qt/5.9.2/android_armv7/src/android/java diff --git a/retroshare.pri b/retroshare.pri index 7f827542f..0b61671f6 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -133,7 +133,7 @@ android-g++ { # message(ANDROID_EXTRA_LIBS: $$ANDROID_EXTRA_LIBS) # message(ANDROID_PLATFORM: $$ANDROID_PLATFORM) # message(ANDROID_PLATFORM_ROOT_PATH: $$ANDROID_PLATFORM_ROOT_PATH) -# message(NDK_TOOLCHAIN_PATH: $$NDK_TOOLCHAIN_PATH) +# message(NATIVE_LIBS_TOOLCHAIN_PATH: $$NATIVE_LIBS_TOOLCHAIN_PATH) } win32 {