templates/gradle-projects/NewAndroidModule/root/native-lib.cpp.ftl
raw| 1 | #include <jni.h> |
| 2 | #include <string> |
| 3 | |
| 4 | <#if activityClass?? && packageName??> |
| 5 | extern "C" |
| 6 | jstring |
| 7 | Java_${packageName?replace('_','_1','i')?replace('.','_','i')}_${activityClass}_stringFromJNI( |
| 8 | JNIEnv* env, |
| 9 | jobject /* this */) { |
| 10 | std::string hello = "Hello from C++"; |
| 11 | return env->NewStringUTF(hello.c_str()); |
| 12 | } |
| 13 | </#if> |