QtAndroid, exchanging data between c++ and android
-
wrote on 2 Nov 2019, 09:04 last edited by mrdebug 11 Feb 2019, 09:04
These are 3 example functions
public void Test01() { System.out.println("Test01"); System.out.println("Test01"); } public void Test02(int a) { System.out.println("Test02"); System.out.println("Test02"); } public int Test03() { System.out.println("Test03"); System.out.println("Test03"); return 321; }
And that is how I call them
QtAndroid::androidActivity().callMethod<void>("Test01", "()V"); QtAndroid::androidActivity().callMethod<void>("Test02", "(I)", 123); QtAndroid::androidActivity().callMethod<jint>("Test03", "()V");
Only the first "Test01" works, the second and the third generate the exception
W System.err: java.lang.NoSuchMethodError: no non-static Test02(I)" W System.err: java.lang.NoSuchMethodError: no non-static Test03()V"
Which kind of mistake am I making?
-
wrote on 2 Nov 2019, 11:58 last edited by
QtAndroid::androidActivity().callMethod<void>("Test02", "(I)V", 123); QtAndroid::androidActivity().callMethod<jint>("Test03", "()I");
-
QtAndroid::androidActivity().callMethod<void>("Test02", "(I)V", 123); QtAndroid::androidActivity().callMethod<jint>("Test03", "()I");
wrote on 2 Nov 2019, 12:24 last edited byThe method signatures are wrong.
2 should be "(I)V", 3 should be "()I"
1/3