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?