/data/local/tmp/
我们编译的Android可执行程序可以放入 /data/local/tmp/ 目录执行,但是可执行文件依赖so时,需要使用以下方式执行:
- 首先把so文件也push到/data/local/tmp/ 目录
- Then just set LD_LIBRARY_PATH to point at that directory:
LD_LIBRARY_PATH=. ./your_executable_file
获取jobject的className
// First get the class object
jmethodID mid = spEnv.get()->GetMethodID(cls, "getClass", "()Ljava/lang/Class;");
jobject clsObj = spEnv.get()->CallObjectMethod(obj, mid);
// Now get the class object's class descriptor
cls = spEnv.get()->GetObjectClass(clsObj);
// Find the getName() method on the class object
mid = spEnv.get()->GetMethodID(cls, "getName", "()Ljava/lang/String;");
// Call the getName() to get a jstring object back
jstring strObj = (jstring)spEnv.get()->CallObjectMethod(clsObj, mid);
// Now get the c string from the java jstring object
const char* str = spEnv.get()->GetStringUTFChars(strObj, NULL);
// Print the class name
AJ_LOGE("Calling class is: %s", str);
// Release the memory pinned char array
// spEnv.get()->ReleaseStringUTFChars(strObj, str);
网友评论