Skip to content

Instantly share code, notes, and snippets.

@initishbhatt
Last active Apr 12, 2018
Embed
What would you like to do?
native function
#include <jni.h>
#include <string>
extern "C" JNIEXPORT jstring
JNICALL
Java_com_initishbhatt_kotilnjnisample_NativeStore_stringFromJNI(
JNIEnv *env,
jobject /* this */) {
std::string hello = "Hello from C++";
return env->NewStringUTF(hello.c_str());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment