JavaVM* m_javaVM = (JavaVM*)QApplication::platformNativeInterface()->nativeResourceForWidget("JavaVM",0);
return always 0xaa00
and
UnionJNIEnvToVoid uenv; uenv.venv = NULL; qDebug()<<m_javaVM->GetEnv(&uenv.venv, JNI_VERSION_1_4);
return -2;
jmethodID playMediaFileMethodID = m_env->GetStaticMethodID(applicationClass,"playMediaFile", "(Ljava/lang/String;)V");
No method from QtApplicaiton.java can be found.
D/Qt (11827): Java Class is: 0x466fc570
W/dalvikvm(11827): threadid=9: thread exiting with uncaught exception (group=0x40020c18)
E/AndroidRuntime(11827): FATAL EXCEPTION: Thread-15
E/AndroidRuntime(11827): java.lang.NoSuchMethodError: playMediaFile
E/AndroidRuntime(11827): at dalvik.system.NativeStart.run(Native Method)
I successfully call Java function from Qt/C++. I will create a little tutorial in few hours. I don't know if this is the best approach, but at least it works and can be used for various tasks.
--
Sent from my Nokia N9
On 29.02.2012 19:51, Endy Silveira wrote:
> Hello George,
>
> I'm working over Necessitas 0.21, theres any way to do the samething
> you do at necessitas 0.3 update 4? It would be REALLY great!
>
> Bests,
>
> Endy
>
> On 28 fev, 17:05, Calugar Mircea - George<geo...@wesell.ro> wrote:
>> I've added a post to my mini-blog related to changes made to use Java
>> Class into the Necessitas.http://blog.wesell.ro/2012-02/how-to-use-java-from-qtc-in-necessitas/
>>
>> Best regards,
>> George Calugar
>>
>> On 28.02.2012 20:06, Nilson Aguiar wrote:
>>
>>
>>
>>
>>
>>
>>
>>> Thanks CMGeorge I'm new in Qt and I will apreciate your tutorial!
>>> Em ter�a-feira, 28 de fevereiro de 2012 14h54min08s UTC-3, CMGeorge
Great! Thank you :)