mirror of
https://github.com/bazel-contrib/rules_foreign_cc
synced 2024-11-25 17:31:25 +00:00
14 lines
273 B
C++
14 lines
273 B
C++
#include <jni.h>
|
|
#include <string>
|
|
|
|
extern "C"
|
|
JNIEXPORT jstring
|
|
|
|
JNICALL
|
|
Java_com_example_android_bazel_MainActivity_stringFromJNI(
|
|
JNIEnv *env,
|
|
jobject /* this */) {
|
|
std::string hello = "Hello from C++";
|
|
return env->NewStringUTF(hello.c_str());
|
|
}
|