Код: Выделить всё
public class NativeClassWrapper {
public static native void userLogin(int id, char[] username, char[] password);
static {
System.loadLibrary("User.dll");
}
public static void main(String[] args) {
userLogin(100000, "user123\0".toCharArray(), "password123\0".toCharArray());
}
}
Код: Выделить всё
// javac -h NativeClassWrapper.java generate C header
/* DO NOT EDIT THIS FILE - it is machine generated */
#include
/* Header for class NativeClassWrapper */
#ifndef _Included_NativeClassWrapper
#define _Included_NativeClassWrapper
#ifdef __cplusplus
extern "C" {
#endif
JNIEXPORT jboolean JNICALL Java_dll_call_NativeClassWrapper_userLogin
(JNIEnv *, jobject, jint, jcharArray, jcharArray);
#ifdef __cplusplus
}
#endif
#endif
TIA
Подробнее здесь: https://stackoverflow.com/questions/790 ... -from-java
Мобильная версия