native-lib.cpp 267 Bytes
Newer Older
1256748979@qq.com committed
1 2 3 4 5 6 7 8 9 10
#include <jni.h>
#include <string>

extern "C" JNIEXPORT jstring JNICALL
Java_com_reyun_sdktestdemo_MainActivity_stringFromJNI(
        JNIEnv* env,
        jobject /* this */) {
    std::string hello = "Hello from C++";
    return env->NewStringUTF(hello.c_str());
}