Add support for NDK r10 version

Modified the code to support the latest version of NDK r10. Please verify.