has anybody tried to access Java class from Android Webkit plugin?
I am trying to do but there is no reliable way to access with JNI. So
if anybody has tried please reply.
here is example of what I want -
JS in webage access plugin and plugin accesses JAVA class/application
to access Android platform and return result.
Regards
Digambar
3rd arg is exactly JNIEnv.
you can do this:
static JavaVM *flashPluginJVM = 0;
NPError NP_Initialize(NPNetscapeFuncs* browserFuncs, NPPluginFuncs*
pluginFuncs, void *java_env, void *application_context)
{
...
if(flashPluginJVM == NULL) {
JNIEnv *jni = (JNIEnv *) java_env;
if( jni->GetJavaVM(&flashPluginJVM) < 0) {
LOGE("NP_Initialize GetJavaVM failed");
}
}
}
ok , now , you have instance of JavaVM. you can do anything you want to do.
Digambar Rasal 写道:
> --
>
> You received this message because you are subscribed to the Google Groups "android-platform" group.
> To post to this group, send email to android-...@googlegroups.com.
> To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
>
>
>
>
I am using same method to get JavaEnv. But I can't find my
implemenation say com/example/testClass with JNI findclass. I can't
find any other class outside webkit also( not even com/android/*
classes).
In addition there are different ways to add Java class -
BUILD_JAVA_LIBRARY, BUILD_HOST_JAVA_LIBRARY or Application package but
none of this makes my Java code available in Webkit Plugin. For all it
gives error java.lang.NoClassDefFoundError
So now I am wondering is it possible to add Java implementation and
access it without changing/adding it to webkit code or am i missing
something,
Regards
Digambar
Digambar Rasal ??:
douchuan 写道: