Wednesday, August 3, 2016

Generating JNI header under Android Studio

For Android Studio projects the command reads like this:

cd C:\<path to your app>\src\main\java

javah -o ../jni/NameOfHeaderFile.h package.name.of.java.class.YourJavaClass

peteroh@PC0D83UU:~/workspace/hmd_service/app/src/main$ cd java/

peteroh@PC0D83UU:~/workspace/hmd_service/app/src/main/java$ javah -o ../jni/hmd_service_jni.h com.levr.hmd_service.HmdNative

==============================================
hmd_service_jni.h
==============================================

/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class com_levr_hmd_service_HmdNative */

#ifndef _Included_com_levr_hmd_service_HmdNative
#define _Included_com_levr_hmd_service_HmdNative
#ifdef __cplusplus
extern "C" {
#endif
/*
 * Class:     com_levr_hmd_service_HmdNative
 * Method:    Init
 * Signature: (Ljava/lang/String;)I
 */
JNIEXPORT jint JNICALL Java_com_levr_hmd_1service_HmdNative_Init
  (JNIEnv *, jclass, jstring);

#ifdef __cplusplus
}
#endif
#endif

No comments:

Post a Comment