So, I am writing an Android application that uses a large C ++ library. Everything works for me so that the java application can call C ++ delegation methods, but I want it so that I can write messages from C ++ to the Android log. This is easy from java, but I donโt understand how to call the java method from C ++. My searches found methods for opening jvm from C ++, which is not at all what I want to do. Ideally, I would like to pass a C ++ log method pointer, which I could then use whenever I wanted. Of course, java does not support method pointers. My java method will look something like this:
private void log(String s){ Log.i(Tag, s);
I just don't know how to allow C ++ to access this method.
java c ++ android android-ndk jni
erock2112 Oct 10 2018-10-10 20:31
source share