FORUMS

Google No Longer Sending Calendar SMS Notifications

In a not entirely surprising move, Google announced that it’s putting an … more

Enable Multi-Window Mode on M Developer Preview

What was not mentioned in yeterday’s keynote was Android M’s multi-window … more

I/O Summary: Google Cardboard Virtual Reality

One year ago, Google introduced cardboard. Amazingly enough, that was all it took to fire … more

Android M Preview Images – XDA TV

Android M preview images are available. That and much more news is covered by Jordan when he … more

Flash in a WebView

Thanks Meter: 0
 
By alexcq, Junior Member on 27th August 2009, 12:39 PM
Post Reply Subscribe to Thread Email Thread
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, 07:47 PM |#2  
Member
Thanks Meter: 9
 
More
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, 09:49 PM |#3  
OP Junior Member
Thanks Meter: 0
 
More
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, 06:43 PM |#4  
Member
Thanks Meter: 9
 
More
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, 09:33 AM |#5  
Junior Member
Thanks Meter: 0
 
More
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, 09:38 AM |#6  
Member
Thanks Meter: 0
 
More
Have you tried asking this question at http://anddev.org ?
3rd October 2010, 02:31 PM |#7  
Junior Member
Thanks Meter: 0
 
More
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, 07:41 PM |#8  
Recognized Developer
Thanks Meter: 169
 
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, 02:35 PM |#9  
Junior Member
Flag indore
Thanks Meter: 0
 
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