Anyone programming using Necessitas (Qt for Android)? -
i working necessitas (qt android). run fine.
now, trying connect dalvik jvm use of android api (gps example). i'm trying java environment using jni:
jnienv *currenv; currenv = 0; if (m_javavm->getenv((void**)¤v,jni_version_1_4) == jni_ok) { qdebug() << "getenv passed"; } else { qdebug() << "getenv failed"; }
m_javavm
pointer virtual machine used necessitas.
the problem getenv failed when run application in android virtual device.
any appreciated!
i answering ow question:
this happens because getenv gets current env. while need to new env like:
if (currvm->attachcurrentthread((void **)¤v, null)<0) { emit error("cannot attach current thread vm"); }
Comments
Post a Comment