jihoon
unread,Aug 26, 2009, 1:28:45 AM8/26/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to android-platform
Hi,
I'm trying to load a webkit plugin (.so file) through WebView /
WebSettings API.
For test purpose, I am using browsertestplugin.so. (which I found in
platform source at "external/webkit/WebKit/android/plugins/sample" and
also in 1.5 image in /system/lib/browsertestplugin.so)
First, I made a simple webpage which embeds 'type="application/x-
testplugin"' tag and loaded it in android browser. This did not
work. After an hour of googling, found out that I need to put
browsertestplugin.so in /data/data/com.android.browser/app_plugins/.
Then, the plugin successfully loaded and showed little red ball
bouncing on wall. Great.
Now, when I try to do the same thing in my own Activity using WebView
class, I don't think this works.
I've placed browsertestplugin.so in "/sdcard/plugins" so that my code
can read & load it.
Following is what I used to load the plugin and the page containing
application/x-testplugin stuff.
-------------------
WebView webview = new WebView(this);
websettings = webview.getSettings();
websettings.setPluginsEnabled(true);
websettings.setPluginsPath("/sdcard/plugins/");
websettings.setAllowFileAccess(true);
webview.refreshPlugins(true);
Log.d("WebViewDemoActivity", "PluginsEnabled: " +
websettings.getPluginsEnabled());
Log.d("WebViewDemoActivity", "PluginsPath: " +
websettings.getPluginsPath());
for (Object o : WebView.getPluginList().getList()) {
Plugin p = (Plugin)o;
Log.d("WebViewDemoActivity", "PluginFileName: " +
p.getFileName());
}
----------------
This did not print any plugin list. (WebView.getPluginList().getList()
returned 0-sized list)
Next, I tried loading the so file directly and constructing Plugin
object manually and adding it to PluginList.
----------------
Plugin pp = new Plugin("Test", "/sdcard/plugins",
"browsertestplugin.so", "Test Plugin");
WebView.getPluginList.addPlugin(pp);
----------------
After this, I could see the "browsertestplugin.so" in
WebView.getPluginList().
However, the site still did not render properly in my WebView (still
showing the blue "no-plugin" icon)
Now I'm stuck and don't know what to do. Any pointers to what the
problem is or what I'm doing wrong would be great.