Android

!!! This page is WIP !!! See  https://groups.google.com/d/topic/ws4d-gsoap-users/kg4Hg1BBIKY/discussion and  https://groups.google.com/d/topic/ws4d-gsoap-dev/QmHEURJv_J8/discussion for more information.

Configure Android NDK

The android toolchain file is based on  http://code.google.com/p/android-cmake/ and works only with android-ndk version r5b or later.

Standalone Toolchain

Since ndk version r5b, the ndk contains a script to create a directory that cotains a standalone cross compiler that can be used for regular c/c++ projects.

You can create a standalone toolchain with the following commands:

$ mkdir toolchain
$ [path to android ndk]/build/tools/make-standalone-toolchain.sh --platform=android-9 --install-dir=[path to toolchain directory]

Instead of android-9 you can specify other android platforms.

Use NDK directly

Since ndk r7b the crosscompiler of the ndk can be used as standalone cross compiler without creating a toolchain directory. So you simply have to install the ndk and no further steps are required.

Configure ws4d-gsoap with android ndk toolchain

The android ndk toolchain can use either a standalone toolchain directory or the ndk directly.

To use a standalone toolchain directory you have to set the ANDROID_STANDALONE_TOOLCHAIN environment variable:

$ export ANDROID_STANDALONE_TOOLCHAIN=[path to standalone toolchain directory]

To use the ndk directly you have to set the ANDROID_NDK environment variable:

$ export ANDROID_NDK=[path to ndk]

Before cross compilation, a non cross compiled version of ws4d-gsoap is required!

The following steps are required to create a cross compilation configuration:

$ mkdir ws4d-gsoap-build-android
$ mkdir ws4d-gsoap-install-android
$ cd ws4d-gsoap-build-android
$ cmake -DCMAKE_TOOLCHAIN_FILE=[path to ws4d-gsoap sources]/toolchains/android_ndk.cmake \
        -DGSOAP_PATH:PATH=[path to gsoap] \
        -DDPWS_HOSTEXEC_PATH:PATH=[path to ws4d-gsoap installation] \
        -DCMAKE_INSTALL_PREFIX:PATH=[path to ws4d-gsoap-install-android directory] \
        -DANDROID_NATIVE_API_LEVEL=[android api version, e.g. android-9] \
        [path to ws4d-gsoap sources]
$ make install

Configure your own project - based on airconditioner example

$ mkdir ac-build-android
$ cd ac-build-android
$ cmake -DCMAKE_TOOLCHAIN_FILE=[path to ws4d-gsoap sources]/toolchains/android_ndk.cmake \
        -DGSOAP_PATH:PATH=[path to gsoap] \
        -DDPWS_PATH:PATH=[path to ws4d-gsoap-install-android directory] \
        -DANDROID_NATIVE_API_LEVEL=[android api version, e.g. android-9] \
        [path to airconditioner sources]
$ make