Nvidia and Robotics w/ Barrett Williams – XDA:DevCon 2014

Robotics continues to dominate our videos from this years XDA:DevCon 2014 in … more

Speed Up Deodexing with JoelDroid Batch Deodexer

Android 5.0 Lollipop brings many under-the-hood changes like changing the default compiler … more

Top 5 Apps for 2014 + Top Xposed Mod of 2014 – XDA TV

Its that time of year where you look back and remember the things that happened … more

NVIDIA SHIELD Tablet Gets Android 5.0.1, OTA Available

The NVIDIA SHIELD Tablet is the latest Android-powered device released by famed GPU … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

Flash in a WebView

OP alexcq

27th August 2009, 01:39 PM   |  #1  
OP Junior Member
Thanks Meter: 0
 
5 posts
Join Date:Joined: Aug 2009
Ooops I posted this to the main Hero forum yesterday by mistake - it is more properly and Android developer post specific to the Hero. . . .

I've been trying to run Flash in a Webview on my Hero.

Flash runs in the standard Browser okay, but I get the 'missing plugin' icon when trying to view anthing with Flash in the WebView.

I'm not sure if it has been disabled, or I just haven't found the right settings. I'm using the standard,

mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setAllowFileAccess(true);
mWebView.getSettings().setPluginsEnabled(true);

Then I'm also calling (through reflection) the 'setFlashPlayerEnabled' method described by cyanogen
http://forum.xda-developers.com/showthread.php?t=521221

//Set Flash Player Enabled
Boolean[] input={new Boolean(true)};
try{
Class cl=Class.forName("android.webkit.WebSettings");
Class[] par=new Class[1];
par[0]=Boolean.TYPE;
Method mthd=cl.getMethod("setFlashPlayerEnabled",par);
mthd.invoke(mWebView.getSettings(),input);
mWebView.loadUrl("file:///android_asset/index.html");
}catch(Exception e){}

But still no Flash in the WebView.

Is there anything else that needs to be called?

How about
setPluginsPath("")

. . . . what path should that call on the Hero?
27th August 2009, 08:47 PM   |  #2  
Member
Thanks Meter: 9
 
31 posts
Join Date:Joined: Jul 2009
Quote:
Originally Posted by alexcq

Code:
}catch(Exception e){}

On general Java principles, I'd put some code in this exception handler to see if something is thrown when you get the method or do the invoke...

Otherwise, no ideas
31st August 2009, 10:49 PM   |  #3  
OP Junior Member
Thanks Meter: 0
 
5 posts
Join Date:Joined: Aug 2009
Thanks for that - generally I'm using

mWebView.loadUrl("http://www.google.com/"+e.toString());

while debugging on the device to have any errors sent to the URL bar. A bit nasty, but it gets me the info.
1st September 2009, 07:43 PM   |  #4  
Member
Thanks Meter: 9
 
31 posts
Join Date:Joined: Jul 2009
Quote:
Originally Posted by alexcq

Thanks for that - generally I'm using

mWebView.loadUrl("http://www.google.com/"+e.toString());

while debugging on the device to have any errors sent to the URL bar. A bit nasty, but it gets me the info.

nice one
19th August 2010, 10:33 AM   |  #5  
Junior Member
Thanks Meter: 0
 
1 posts
Join Date:Joined: Aug 2010
Android 2.2 Flash in a WebView
Hi,
I just tried loading a swf in a WebView and it seems to be working. I needed to enable setPluginsEnabled(true); which I saw in your post. Thanks.
19th August 2010, 10:38 AM   |  #6  
Member
Thanks Meter: 0
 
92 posts
Join Date:Joined: Apr 2010
Have you tried asking this question at http://anddev.org ?
3rd October 2010, 03:31 PM   |  #7  
Junior Member
Thanks Meter: 0
 
7 posts
Join Date:Joined: Aug 2010
let me guess - Android version is 2.1 or lower
I came to that conclusion after i noticed that on my N1 running 2.2 this works flawlessly but on my Evo running 2.1 it shows gibberish.

am i correct?
23rd February 2011, 08:41 PM   |  #8  
Recognized Developer
Thanks Meter: 168
 
733 posts
Join Date:Joined: Jul 2009
Donate to Me
More
Hello all.

After trying using flash in my application, I have been very disapointed.

Once the webview is loaded, all my activity blink.

You can find a more accurate description, and the source code of the issue here: http://stackoverflow.com/questions/5...iew-with-flash

and the demo apk here: http://cl.ly/3g0s1p030j243y0p3m2F


Thank a lot for any help, I cannot sleep till I fix this issue...
3rd December 2014, 03:35 PM   |  #9  
Junior Member
Flag indore
Thanks Meter: 0
 
19 posts
Join Date:Joined: Sep 2014
More
Flash content loading fine in webview, but in postDelayed thread it freezes.
Webview get stuck/freezes when i continuously load multiple webviews in a runnable thread in android having flash content.
How can i continue rendering my webview in thread . right first it loads fine and then it start rendering slow and then after a point it freezes.

Post Reply Subscribe to Thread

Tags
android, flash, hero, websettings, webview
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes