From 89438ba0acb15285c992aacbc3bc43d29bd64916 Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Tue, 8 Nov 2016 16:52:09 -0800 Subject: [PATCH] android: update readme with build and testing info --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index e08f3cc..d940742 100644 --- a/README.md +++ b/README.md @@ -228,6 +228,24 @@ cmake .. -DCMAKE_TOOLCHAIN_FILE=/path/to/mxe/usr/x86_64-w64-mingw32.static/share make ``` +### Building for Android + +Install the dependencies: + + * cmake + * Android NDK + +The Android NDK provides a CMake toolchain file for cross-compilation starting in version r13. Run the following, where "ANDROID_NDK_HOME" is the root folder of the NDK: + +``` +mkdir build +cd build +cmake .. -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake" -DANDROID_PLATFORM=android-21 +make +``` + +If you are compiling for an emulator, you probably also want to add the CMake variable `-DANDROID_ARCH=x86`. Further variables are documented in the toolchain file. + ### Testing For each backend, do the following: @@ -254,6 +272,12 @@ For each backend, do the following: 0. Run `./latency` and make sure the printed beeps line up with the beeps that you hear. +### Testing for Android + +Currently when run from the command-line, input streams always fail at +`soundio_instream_open` due to the Android permissions model. Input devices will +only work in full-featured Android apps. + ### Building the Documentation Ensure that [doxygen](http://www.stack.nl/~dimitri/doxygen/) is installed,