Mercurial
comparison gara/android/ndk/app/src/main/cpp/native-lib.cpp @ 47:829623189a57
[Gara] Android commit. Bazelfied it.
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Sat, 13 Dec 2025 14:20:34 -0800 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 46:b9a40c633c93 | 47:829623189a57 |
|---|---|
| 1 #include <jni.h> | |
| 2 #include <string> | |
| 3 | |
| 4 extern "C" | |
| 5 JNIEXPORT jstring | |
| 6 | |
| 7 JNICALL | |
| 8 Java_com_example_android_bazel_MainActivity_stringFromJNI( | |
| 9 JNIEnv *env, | |
| 10 jobject /* this */) { | |
| 11 std::string hello = "Hello from C++"; | |
| 12 return env->NewStringUTF(hello.c_str()); | |
| 13 } |