qt for android 怎么调用jar包,这么调用不行,是我哪一步做错了呢
// 调用构造函数
QAndroidJniObject testObj("test/Test", "(I)V", 10);
if(testObj.isValid()){
QMessageBox::about(NULL, "testObj", "is valid");
// 调用成员函数
jint fun2Ret = testObj.callMethod<jint>("fun2", "()I");
QString str2 = QString("%1").arg(fun2Ret);
QMessageBox::about(NULL, "fun2Ret", str2);
// 调用静态函数
jint fun1Ret = QAndroidJniObject::callStaticMethod<jint>("test/Test", "fun1", "()I");
str2 = QString("%1").arg(fun1Ret);
QMessageBox::about(NULL, "fun1Ret", str2);
}
else {
QMessageBox::about(NULL, "testObj", "is no vaild");
}