1 2 3 4 5 6 7 8 9 10 11 12
#include <jni.h> #include <string> extern "C" JNIEXPORT jstring JNICALL Java_de_spacekookie_lockchain_MainActivity_stringFromJNI( JNIEnv *env, jobject /* this */) { std::string hello = "Hello from C++"; return env->NewStringUTF(hello.c_str()); }