Answer the question
In order to leave comments, you need to log in
C++, working with .cpp?
#include <string.h>
#include "my_mega_pack_NativeCallsClass.h"
JNIEXPORT jint JNICALL Java_my_mega_pack_NativeCallsClass_printString
(JNIEnv * jenv, jobject jobj, jstring jstr) {
const char *string = jenv->GetStringUTFChars(jstr, 0);
const int size = (unsigned)strlen(string);
printf("Первый в Dll \n");
jenv->ReleaseStringUTFChars(jstr, string);
return size;
};
JNIEXPORT void JNICALL Java_my_mega_pack_NativeCallsClass_printOne
(JNIEnv *jenv, jobject jobj){
printf("DLL => You are called PrintOne \n");
};
JNIEXPORT void JNICALL Java_my_mega_pack_NativeCallsClass_printTwo
(JNIEnv * jenv, jobject jobj, jint num) {
printf("DLL => You are called PrintTwo with input param: %d\n ", num);
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question