Tuesday, August 23, 2016

jni register native methods

env->RegisterNatives(clazz, gMethods, sizeof(gMethods) / sizeof(gMethods[0])
static JNINativeMethod gMethods[] = {
    { "_nativeGetBoardHWVersion", "()Ljava/lang/String;", (void *) nativeGetBoardHWVersion },
    { "_nativeGetBoardSWVersion", "()Ljava/lang/String;", (void *) nativeGetBoardSWVersion },
    { "_native_enterUpdateMode",         "()I",                      (void *)native_enterUpdateMode },
    { "_native_init",         "()V",                              (void *)native_init },
    { "_native_setup",        "(Ljava/lang/Object;)V",            (void *)native_setup },
    { "_native_start_unix_socket_thread",        "()V",            (void *)native_start_unix_socket_thread },
    { "_native_release",            "()V",                        (void *)native_release },
    { "_native_finalize",            "()V",                       (void *)native_finalize },
};

No comments:

Post a Comment