> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>
>
JNIEXPORT jlong JNICALL Java_com_example_test_testString (JNIEnv *,
jclass, jstring);
The jclass is the 'this' of the class the JNI function belongs to.
That's why it's saying your object isn't a string; it's not.
If you use javah to create your JNI method signatures, you'll not make
this mistake. I wrote a simple shell script to regenerate my JNI header
for me:
(cd bin && /c/Devel/jdk/bin/javah.exe -o
../jni/include/qz/android/jni_init.h -jni com.recharge.lib.JNIclass)
...where jni_init.h is the file it writes, and JNIclass is the name of
the Java class that is exporting the native functions. You can add
additional copies of that line for each header you want to generate.
If the signature changes, I get a build error in C++. I just
copy-and-paste from the header to the C++ file, adding in names for the
parameters.
Tim
__________ Information from ESET NOD32 Antivirus, version of virus signature database 5251 (20100704) __________
The message was checked by ESET NOD32 Antivirus.