Closed chaorunrun closed 3 years ago
hmmmmm I was really stupid. The native object address was actually returned by MethodFlag.CPP_NEW marked method. It means that
public class ABCManager {
public static class ABC {
@JniMethod(flags={MethodFlag.CPP_NEW}
public static final native long ABC();
}
}
long pointer_to_obj = ABC.ABC();
will do things right.
This may be stupid but I am so confused how to call a native method with 'long' pointer to the object under neath.
For example, the c++ binding code could be
in another caller .java file the c++ binding is called by
And the compile will report error on missing argument 'long' self. Is there a common way to get the 'long' pointer to a specific object(make a method return this)?