1. Download our Official Android App: Forums for Android!

Apps Flash in android

Discussion in 'Android Development' started by super_nova, Sep 17, 2011.

  1. super_nova

    super_nova Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Aug 27, 2011

    Aug 27, 2011
    2
    0
    5
    I want to play a flash file .swf file in android .....for that i have written the code which is below............Can anybody help me where is the fault..and how to play a flash file..........

    package com.android.hello;

    import android.app.Activity;
    import android.os.Bundle;
    import android.webkit.WebView;

    public class TestrunActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
    WebView mWebView;
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    mWebView =(WebView) findViewById(R.id.webview);
    mWebView.getSettings().setJavaScriptEnabled(true);
    mWebView.getSettings().setPluginsEnabled(true);
    mWebView.getSettings().setAllowFileAccess(true);

    String html =
    "<object width=\"550\" height=\"400\"> <param name=\"movie\" value=\"file:///android_asset/sun_clock.swf\"> <embed src=\"file:///android_asset/sun_clock.swf\" width=\"550\" height=\"400\"> </embed> </object>";
    String mimeType = "text/html";
    String encoding = "utf-8";
    mWebView.loadDataWithBaseURL("null", html, mimeType, encoding, "");
    }
    }


    I will be veru thanfull to u ..........:) :eek:
     

    Advertisement

Share This Page

Loading...