I open a browser from my c++ like this:
void jni_openURL(const char* url) {
//LLamar a funcion desde la instancia hungrypigs.
jclass appClass = mEnv->GetObjectClass(appClassObj);
jmethodID mid = mEnv->GetMethodID(appClass, "openURL",
"(Ljava/lang/String;)V");
mEnv->CallVoidMethod(appClassObj, mid, mEnv->NewStringUTF(url));
//llamar a la funcion
}
But you need to have appClassObj initiated, i do that calling a method
named nativeInstanceInit from Java:
void package_class_nativeInstanceInit(JNIEnv* env, jobject thiz) {
appClassObj = env->NewGlobalRef(thiz);
}
I used this guide:
http://journals.ecs.soton.ac.uk/java/tutorial/native1.1/implementing/index.html
Hope that can help.
> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/6Mkd0NxveGEJ.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.