First, the corresponding type symbol
Java type Symbols
Boolean Z
BYTE B
Char C
Short S
int I
Long J
Float F
Double D
void V
It is particularly important to note that the long type corresponds to the notation J, not the l!!!
Second, partial error analysis
JNI encounters error:request for member ' Findclass ' in something not a structure or union
- The possible problems are:
If it is a C program, use (*ENV)
If C + + is to use env->
- The following are the differences between the two:
/*
* We use inlined functions for C + + so that programmers can write:
*
* Env->findclass ("java/lang/string")
*
* in C + + rather than:
*
* (*env)->findclass (env, "java/lang/string")
*
* in C.
*/
Which is used in C + +
Env->findclass ("java/lang/string")
Use in C
(*env)->findclass (env, "java/lang/string")
Iii. Examples of Use
- Local corresponding classes
- JNI implementations (. C implementations)
Android Jin Returns structure