Skip to content

Instantly share code, notes, and snippets.

@0xF6
Created November 9, 2015 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0xF6/833ba3c0b7cd7de416b2 to your computer and use it in GitHub Desktop.
Save 0xF6/833ba3c0b7cd7de416b2 to your computer and use it in GitHub Desktop.
JNI String to const char*
const char* toConstChar(JNIEnv* pEnv, jstring jStr)
{
const char* nativeString = pEnv->GetStringUTFChars(jStr, JNI_FALSE);
pEnv->ReleaseStringUTFChars(jStr, nativeString);
return nativeString;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment