Category : jvm

public class some_class { public static void som_func() { var some_object = new SomeObject(); var ret = 0; do { ret = some_object.DoSomething(); } while(ret != 1); System.out.printf("Return value: %d", ret); } } Now in C++ if I call like this way: auto some_cls = g_env->FindClass("some_class"); auto some_func = g_env->GetStaticMethodID(some_cls, "som_func", "()V"); g_env->CallStaticVoidMethod(some_cls, some_func); Is ..

Read more

This is basically a question "why high-level languages are slower than low-level". It is known that high-level languages provide more human-friendly abstractions, but what does it have to do with runtime speed? Is it just because high-level languages are VM-based or because they’re dynamically typed? So the question is: Would it be possible to achieve ..

Read more

Working in VisualStudio2017, I’m trying to get to use Java methods within a C++ program, and to that end I’m performing the example shown here, i.e. : #include <jni.h> int main() { Using namespace std; JavaVM *jvm; // Pointer to the JVM (Java Virtual Machine) JNIEnv *env; // Pointer to native interface //================== prepare loading ..

Read more

First of all let me state that I’m a c++ developer and I’m new to Android/Java/JNI. I have an android application written in Java where I call native c++ methods. Those methods often need to call java methods too. Calling FindClass, GetMethodX GetFieldX every time that I need something is ugly and probably also consumes ..

Read more