Started adding some JNI support for future android port