How to get application context for JNI library
I am trying to use a Android Java library with Unreal JNI. Problem is that the library requires an Android application context, and I have not been able to find out how to get it in Unreal.
The GameActivitivity.java naturally has an context available, but passing that through c++ code to a library seems to either mangle the context reference so that it becomes invalid object or weak ref, or the method is not found due to false signature, I think.
Here is one trial
This results into runtime error
Any ideas how to fix? Or a better way to obtain context?
I ended up solving this by calling java lib directly from UPL file, where you can get the context simply by
answered Apr 11 '19 at 12:23 PM
answered Apr 05 '19 at 12:36 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here