Announcement

Collapse
No announcement yet.

extending native JNI methods in GameActivity

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    extending native JNI methods in GameActivity

    Hello,

    I need to add support for another VR input device (GoogleVR), and so far have everything working in the application layer (the java part), and have the necessary .so files being bundled in the final APK package.

    Where I am stuck is figuring out the best way to add/override the default native JNI methods exposed in libUE4.so. Can I just expose extra JNI methods in my C++ PlayerController? What if I need to hook into the render loop and inject my own code before painting? I could probably get most of what I need if I could find how/where libUE4.so is produced in the build (I assume it's just a standard ndk-build?). Any insights or advice would be greatly appreciated.

    Thanks for your time!

    #2
    Hi Drkstr101,

    GoogleVR is supported in 4.12 already as two plugins (GoogleVRHMD and GoogleVRController). You can take a look in these to see how JNI is used, for example FGoogleVRController::FGoogleVRController(). Android Plugin Language (the APL XML files) add Java code to GameActivity.java.

    Comment


      #3
      Awesome, I just found it. You just made my day!

      Cheers and thank you!

      Comment

      Working...
      X