2021.04.08

cmake
This commit is contained in:
FHT
2021-04-08 18:20:51 +08:00
parent e9a718484b
commit 85944ed6ce
4 changed files with 72 additions and 6 deletions

View File

@@ -0,0 +1,15 @@
//
// Created by Administrator on 2021/4/8.
//
#include <jni.h>
#include <string>
extern "C"
JNIEXPORT jstring
JNICALL
Java_com_tt_ttutils_jni_NDKTools_getStringFromNDK(
JNIEnv *env, jobject /* this */) {
std::string hello = "Hello from C++";
return env->NewStringUTF(hello.c_str());
}

View File

@@ -2,7 +2,8 @@ package com.tt.ttutils.jni;
public class NDKTools {
static {
System.loadLibrary("NDKTools-jni");
// System.loadLibrary("NDKTools-jni");
System.loadLibrary("native-lib");
}
public static native String getStringFromNDK();