Go-SDL2 example running on Android.
Golang example is compiled to C shared library and then linked with the help of Android.mk files from SDL2.
SDLActivity.java is used, same as with C/C++ and SDL2.
To compile example you will need Android NDK and Android SDK , download and unpack archives somewhere.
Go toolchain must be cross compiled for android/arm. There is a bootstrap script you can use to compile toolchain and SDL2. Make sure you have mercurial/hg, curl and ant installed.
ANDROID_NDK=/opt/android-ndk ./bootstrap.bash /usr/local
Point ANDROID_NDK to directory where you unpacked archive, /usr/local is prefix where Go and android toolchains will be installed.
After build is complete you must first compile example to shared library, GOROOT needs to point to toolchain that we compiled for android:
cd example
ANDROID_TOOLCHAIN=/usr/local/android-toolchain-arm GOROOT=/usr/local/go ./make.bash
And to build apk:
cd android
ANDROID_NDK=/opt/android-ndk ANDROID_SDK=/opt/android-sdk ./make.bash
If everything is successfully built apk can be found in android/bin directory.