I am new to using JNI and so I am trying to get a double
and an unsigned int
from a native library in C and return the values to my java side but I keep getting the following errors from Android Studio
Error:(111, 37) error: called object type 'double' is not a function or function pointer
Error:(117, 43) error: called object type 'unsigned int' is not a function or function pointer
Error:(220, 19) error: functions that differ only in their return type cannot be overloaded
Here is my code:
double SuperpoweredExample::getPosition() {
double pos = playerA->positionMs();
return pos;
}
unsigned int SuperpoweredExample::getDuration() {
unsigned int dur = playerA->durationMs();
return dur;
}
while this is the Extern C structure
JNIEXPORT jdouble Java_com_superpowered_crossexample_MainActivity_getPosition(JNIEnv *javaEnvironment, jobject self) {
return example->getPosition();
}
JNIEXPORT jint Java_com_superpowered_crossexample_MainActivity_getDuration(JNIEnv *javaEnvironment, jobject self) {
return example->getDuration();
}
Please guys, I will appreciate any help at all... Thank you in advance