Search code examples
javac++java-native-interfaceunreal-engine4

How to make Unreal Engine 4 work with JNI?


I had a question about Unreal Engine 4. I am writing a game on android and I need to calculate the pulse of a person’s pulse using a photoplethysmogram. I already wrote the game and found an example of reading the pulse on the github, but I can’t imagine how to access the camera and the flashlight of the mobile phone through the Java and Unreal Engine 4/c++. I googled about JNI, but did not find the normal documentation or examples of how Unreal work with this that were explained . Can anyone help with this?


Solution

  • This plugin should help:

    https://github.com/Sovahero/PluginMobileNativeCode

    Call Jni code with a single C++ function: AndroidUtils::CallJavaCode<ReturnType>(“com/epicgames/ue4/YourClass”, “YourFunction”, false, “arg1”,“arg2”,“arg3”)