Check out the news from yesterday. Whatever you're doing is already
obsolete.
On 11/10/2011 1:09 PM, Ratheesh Valamchuzhy wrote:
i am trying to play an swf file in android emulator(2.3), but it is
not playing , if any one know the reason plse help me ., here is my
code
package com.playswf;
import java.io.File;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebSettings.PluginState;
public class playswf extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
WebView mWebView1 = (WebView) findViewById(R.id.webview1);
mWebView1.getSettings().setJavaScriptEnabled(true);
String encoding = "utf-8";
mWebView1.getSettings().setPluginsEnabled(true) ;
mWebView1.getSettings().setPluginState(PluginState.ON);
mWebView1.getSettings().setAllowFileAccess(true);
//mWebView1.getSettings().setPluginState(WebSettings.PluginState.ON);
//file is in sd cared
// String html = "<object width=\"550\" height=\"400\"> <param
name=\"movie\" value=\"file:///sdcard/anim.swf\"> <embed
src=\"file:///sdcard/anim.swf\" width=\"550\" height=\"400\"> </embed>
</object>";
//file is in asset folder
String html = "<object width=\"550\" height=\"400\"> <param
name=\"movie\" value=\"file:///android_asset/anim.swf\"> <embed
src=\"file:///android_asset/anim.swf\" width=\"550\" height=\"400\">
</embed> </object>";
String mimeType = "text/html";
//String encoding = "utf-8";
// mWebView1.loadData(html, mimeType, encoding, "");
mWebView1.loadDataWithBaseURL("null", html, mimeType, encoding, "");
// setContentView( mWebView1);
// mWebView1.loadUrl("file:///sdcard/anim.swf");
}
}
i also attached the full code with this mail
--
--
ωιтн яєgαя∂ѕ
Ratheesh **...........
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
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
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
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