1

Using this question for guidance, I was able to successfully build my project with a C++ .so file in the libs directory.

However, I am not sure how to actually use it from MainActivity.kt.

The C++ class I'm using is Number:

class Number {
    int number;
public:
    Number(int n) { number = n };
    bool isEven() { return number % 2 == 0 };
};

Assuming I've added the shared library file correctly, how do I actually use it?

Daniel C Jacobs
  • 691
  • 8
  • 18
  • You can only call C++ functions that have been exported and named in a certain way. And interacting with non-primitive C++ types can be done in more than one way. I suggest that you search for some kind of JNI tutorial since this is a bit of broad topic. – Michael Jan 12 '22 at 15:37

0 Answers0