Category : java-native-interface

I have a Xtext project and for the validator, I need to call C++ functions. I have generated the header file and created the corresponding cpp file DummyValidator.h /* DO NOT EDIT THIS FILE – it is machine generated */ #include <jni.h> /* Header for class com_example_dummy_validation_DummyValidator */ #ifndef _Included_com_example_dummy_validation_DummyValidator #define _Included_com_example_dummy_validation_DummyValidator #ifdef __cplusplus extern ..

Read more

I am developing an android app where I have to use a shared library (cross-compiled on linux system using NDK toolchain). Below are the steps I followed: I am using the ‘hello-libs ndk sample‘. The shared library name is libsum.so, where I have two function definitions: int sum(int a, int b); int sub(int a, int ..

Read more

This is my PseudoStream class which interfaces with C++ class PseudoStream{ companion object{ // This native function receives a String as a Input and returns a Modified output external fun output(input: String): String } } This is the C++ Inteface code to for the output function // Creates a jstring from a std::string passed as ..

Read more