modify to build with Android NDK