Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to insert a swf animation (flash) in Java for Android (Eclipse)

I've been googling it for days and I still can't find anything, I've already tried some codes, but I'm also really noob at java so every single code I've been trying, it fails...

Well, I'm going to try to explain.

I'm coding an app which uses 3 activities. The first one has a button that opens the 2nd activity, and in the second activity I wanted to play an animation, but once I can't make it play a video, nor a .gif, I've converted the gif to .swf, and I still can't make it work.

Then I noticed that the problem must be mine :P

It's the first question I'm making, and I swear I've already looking at the others but I really can't find a solution... But as far as I know you're a pretty good community that like to help the others, and I really appreciate it.

Can you guys help me putting my .swf working when I launch the second activity? I'd be very grateful. Btw, if you don't understand something that I said, just let me know, I know my english isn't the best :p

Best regards, xickoh

like image 448
xickoh Avatar asked Feb 26 '26 09:02

xickoh


1 Answers

Android version higher than Gingerbread(2.3) does not support Flash. For Android version below ICS(4.~), you can insert a swf file to webview.

WebView wv = (WebView) findViewById(your id);
WebSettings ws = wv.getSettings();
ws.setPluginState(PluginState.ON);
ws.setJavaScriptEnabled(true);
wv.loadUrl(SWF FilePath);

Hope this helps.

like image 165
sam Avatar answered Feb 27 '26 23:02

sam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!