Calling C++ from Java is fairly trivial TBH. The other-way is a little tougher but also not too bad. Jules has maid some great Macros for it.
Here is how I use my C++ function "galleryImageChose" being called from Java to C++
JUCE_JNI_CALLBACK (JUCE_ANDROID_ACTIVITY_CLASSNAME, galleryImageChosen, void, (JNIEnv* env, jobject activity,
jstring url, jstring future))
String imagePath = juceString (env, url);
String orientationString = juceString (env, future);
//internal call here
define it in Java
private native void galleryImageChosen (String url, String future);
Then call in Java
Going up to Java is a little tougher but here is an example.
In juce_android_JNIHelpers.h you must define your function. There are a whole lot of them to get examples from but I created a "shareImage". Find the #define JNI_CLASS_MEMBERS(METHOD, STATIMETHOD, FIELD, STATICFIELD) macro and at the bottom add a \ to add a line to the macro then put in this
METHOD (shareImage, "shareImage", "(Ljava/lang/String;)V")
This will define a function named "shareImage" that takes a Java::String. There are more complex options for objects passed and returned however I do not use most of them as String usually suffices for what I need done.
To call this function do this:
const LocalRef<jstring> t (javaString (fileName));
android.activity.callVoidMethod (JuceAppActivity.shareImage, t.get());
Then in your Java add:
public final void shareImage(String fileName)
//whatever you want here...