Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the naming convention of JNI call in android

Tags:

android

For example, in android Java code, it calls a native method:

private native final String native_getParameters();

Where/how should I grep where is the C++ method defined native_getParameters();?

Thank you.

like image 257
michael Avatar asked Dec 14 '25 05:12

michael


1 Answers

The C++ method will also contain your namespace (e.g. com.domain.your) and classname (e.g. YourActivity), it will look something like

JNIEXPORT jstring JNICALL Java_com_domain_your_YourActivity_native_1getParameters(JNIEnv * env, jclass clazz)

Note the C++ _1 equates to the _ in your Java method

like image 61
Rob Avatar answered Dec 16 '25 10:12

Rob



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!