Search code examples
androidflashuser-agentgalaxy-tab

Flash Player doesn't work when setting a Custom User agent in WebView on Galaxy tab


I am trying to use the Flash + Set the browser to a desktop agent on the Galaxy Tab.

mWebview.getSettings().setUserAgentString("Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.11) Gecko/20101019 Firefox/3.6.11"); mWebview.getSettings().setPluginsEnabled(true);

So the issues is, when the UserAgentString param is enabled, flash player wont load as many websites like Iplayer don't recognise the browser in the WebView.

This may be a bug in the Samsung browser. Anyone have any desktop agents that the WebView will accept whilst enabling flash?

Thanks, Chris


Solution

  • Well it seems that its a combination of problems. But I found solution.

    Using the AgentString = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/0.2.153.1 Safari/525.19

    Most of the sites I needed worked. BBC IPlayer which seems to do some more checks returns an incompatible device. So I did a bit of a dirty hack for this site.

    if(url.contains("bbc.co.uk")){ view.getSettings().setUserAgentString("Mozilla/5.0 (Linux; U; Android 3.0.1; en-gb; MZ601 Build/H.6.1-38-1) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13"); }else{ view.getSettings().setUserAgentString("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/0.2.153.1 Safari/525.19"); } view.loadUrl(url);

    This worked for me, if anyone could shed more light on how some sites detect device that would be great as it seems to be more than User-Agent.