lime icon indicating copy to clipboard operation
lime copied to clipboard

Is there a way to call constructor from java class via jni

Open Sirox228 opened this issue 2 years ago • 1 comments

Screenshot_2022-07-13-15-43-31-190_com android chrome

i was making a lib that have some of java android classes ported to haxe via jni, but i need to call constructor, could it be called via jni?

Sirox228 avatar Jul 13 '22 12:07 Sirox228

It seems there is, though it isn't documented and the code is somewhat confusing. Short version is try this:

var processConstructor = JNI.createStaticMethod("android/os/Process", "<init>", "()V");
var process = processConstructor();

Where I got this information:

player-03 avatar Jul 15 '22 16:07 player-03