I just had to place the cpp file name in the Android.mk file… This is my first time so sorry…
Fixed code:
C++
#include <string.h>
#include <jni.h>
extern "C"
{
JNIEXPORT jint JNICALL Java_net_pixeldroidof_addonedit_MainActivity_getScreenY(JNIEnv* env, jobject thiz)
{
int number = 30;
return number;
}
}
Java
public native static int getScreenY();
//And you can start calling it(example: getScreenY() will now return the value from the cpp)
solved Call a c++ function that returns a int value from java