Calling a Java/Android method from C/C++ | Techbirds
Continuing my previous blog on how to use native code using JNI. I am sharing an example on how to call Java/android method from your native code(c/c++). com.exapmle.android.MainActivity.java public class MainActivity extends Activity { private static String libname = “mylib”; static { System.loadLibrary(libname);} @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main_activity); String result = call_to_native();