Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Java: Create a nativ method

  2. C++: Create a matching implementation

  3. Store the C++ implementation inside a shared library

  4. Compile the shared library with CMake

  5. Load the shared library with System.LoadLibrary()

  6. Call the JNI method

Note: When a Java native method is called before the implementation is loaded it leads to a crash!

More details about more complex data transfer can be found in the following topics:

Low level: C++ and JNI data transfer
High level: C++ and JNI data transfer

...