update build process for Android

This commit is contained in:
badaix 2018-04-12 23:45:01 +02:00
parent 43184062b6
commit ad0d9325a9
4 changed files with 13 additions and 14 deletions

View file

@ -97,7 +97,7 @@ Snapcast can be controlled using a [JSON-RPC API](doc/json_rpc_api/v2_0_0.md):
* Assign a client to a stream * Assign a client to a stream
* ... * ...
There is an Android client available in [Releases](https://github.com/badaix/snapcast/releases/latest) There is an Android client [snapdroid](https://github.com/badaix/snapdroid) available in [Releases](https://github.com/badaix/snapdroid/releases/latest)
![Snapcast for Android](https://raw.githubusercontent.com/badaix/snapcast/master/doc/snapcast_android_scaled.png) ![Snapcast for Android](https://raw.githubusercontent.com/badaix/snapcast/master/doc/snapcast_android_scaled.png)

View file

@ -1,24 +1,23 @@
#/bin/sh #/bin/sh
if [ -z "$NDK_DIR_ARM" ] && [ -z "$NDK_DIR_MIPS" ] && [ -z "$NDK_DIR_X86" ]; then if [ -z "$NDK_DIR_ARM" ] && [ -z "$NDK_DIR_X86" ]; then
echo "Specify at least one NDK_DIR_[ARM|MIPS|X86]" echo "Specify at least one NDK_DIR_[ARM|X86]"
exit
fi
if [ -z "$ASSETS_DIR" ]; then
echo "Specify the snapdroid assets root dir ASSETS_DIR"
exit exit
fi fi
if [ -n "$NDK_DIR_ARM" ]; then if [ -n "$NDK_DIR_ARM" ]; then
export NDK_DIR="$NDK_DIR_ARM" export NDK_DIR="$NDK_DIR_ARM"
export ARCH=arm export ARCH=arm
make clean; make TARGET=ANDROID -j 4; mv ./snapclient ../android/Snapcast/src/main/assets/bin/armeabi/ make clean; make TARGET=ANDROID -j 4; mv ./snapclient "$ASSETS_DIR/bin/armeabi/"
fi
if [ -n "$NDK_DIR_MIPS" ]; then
export NDK_DIR="$NDK_DIR_MIPS"
export ARCH=mips
make clean; make TARGET=ANDROID -j 4; mv ./snapclient ../android/Snapcast/src/main/assets/bin/mips/
fi fi
if [ -n "$NDK_DIR_X86" ]; then if [ -n "$NDK_DIR_X86" ]; then
export NDK_DIR="$NDK_DIR_X86" export NDK_DIR="$NDK_DIR_X86"
export ARCH=x86 export ARCH=x86
make clean; make TARGET=ANDROID -j 4; mv ./snapclient ../android/Snapcast/src/main/assets/bin/x86/ make clean; make TARGET=ANDROID -j 4; mv ./snapclient "$ASSETS_DIR/bin/x86/"
fi fi

View file

@ -1,7 +1,7 @@
#/bin/sh #/bin/sh
export NDK_DIR_ARM="$1-arm" export NDK_DIR_ARM="$1-arm"
#export NDK_DIR_MIPS="$1-mips"
export NDK_DIR_X86="$1-x86" export NDK_DIR_X86="$1-x86"
export ASSETS_DIR="$2"
./build_android.sh ./build_android.sh

View file

@ -161,9 +161,9 @@ Cross compile and install FLAC, ogg, and tremor (only needed once):
Compile the Snapclient: Compile the Snapclient:
$ cd <snapcast dir>/client $ cd <snapcast dir>/client
$ ./build_android_all.sh <android-ndk dir> $ ./build_android_all.sh <android-ndk dir> <snapdroid assets dir>
The binaries for `armeabi` and `x86` will be copied into the Android's assets directory (`<snapcast dir>/android/Snapcast/src/main/assets/bin/`) and so will be bundled with the Snapcast App. The binaries for `armeabi` and `x86` will be copied into the Android's assets directory (`<snapdroid assets dir>/bin/`) and so will be bundled with the Snapcast App.
## OpenWrt/LEDE (Cross compile) ## OpenWrt/LEDE (Cross compile)