Hi, I am trying to use a Google Gears enabled site in Android's
WebView, but it fails, saying Gears is not installed.

For example, my test application sets up a WebView and loadUrls:
http://code.google.com/apis/gears/samples/hello_world_geolocation.html

and I see a "Gears is not installed" message.

The WebSettings on the WebView has JavaScript and Plugins enabled.
WebView.getPluginList is empty.


import java.util.List;

import android.app.Activity;
import android.graphics.Path;
import android.graphics.drawable.GradientDrawable.Orientation;
import android.os.Bundle;
import android.webkit.Plugin;
import android.webkit.PluginList;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.LinearLayout;

public class HelloAndroid extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        WebView webView = new WebView(this);
                WebSettings settings = webView.getSettings();
                settings.setJavaScriptEnabled(true);
                settings.setPluginsEnabled(true);
                webView.refreshPlugins(true);
                PluginList pluginList = webView.getPluginList();
                List list = pluginList.getList();
                for(int i = 0; i < list.size(); i++)
                {
                        Plugin plugin = (Plugin)list.get(i);
                }
                webView.loadUrl("http://code.google.com/apis/gears/samples/
hello_world_geolocation.html");

                LinearLayout layout = new LinearLayout(this);
                layout.setOrientation(LinearLayout.VERTICAL);
                Button button = new Button(this);
                layout.addView(button);
                layout.addView(webView);
        setContentView(layout);
    }
}

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to