According to this link, in order to invoke Java methods from native (C++) code using JNI, the GetMethodID function is used to:
"return the method ID for an instance (nonstatic) method of a class or interface."
Consider, as an example, the following constructor of the File class:
public File(Uri uri)
A JNI method signature for this constructor would be:
"Ljava/io/File;.(Landroid.net.Uri;)V"
But, since Uri is an abstract class, is it possible to retrieve the method ID for this constructor using a signature that contains types that are derived from Uri ?
*I am asking this, since I'm using an environment where the actual signature is being automatically created based on the runtime object type, but that seems to fail, but i am not sure if its a limitation of JNI or a bug in the signature creation code, or something else entirely.
class.getConstructors()and check the parameter types) but I'm not a JNI expert either so I can't say for sure. If you use reflection, JNI has a conversion function so you don't have to build a string signature once you have the rightConstructor.