Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flash is not loading in Web view in Android

I am trying to Load a webview in Android. Where web page have a swf file but it is not loading. I know there are many question and answer on same topic but no one helped me.

I have already targeted it version 11. And I have put android:hardwareAccelerated="true" too in manifest.xml file.

enter image description here

My code is here-

public class MainActivity extends Activity {

    private WebView mWebView;

    String url="http://mypages.com/Ch_001/ScoPage.html";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        mWebView = (WebView) findViewById(R.id.webView);
        mWebView.setKeepScreenOn(true);
        WebSettings settings = mWebView.getSettings();
        settings.setPluginState(PluginState.ON);

        mWebView.getSettings().setJavaScriptEnabled(true);
        mWebView.getSettings().setDomStorageEnabled(true);
        mWebView.getSettings().setBuiltInZoomControls(true);
        mWebView.setInitialScale(100);
        // wbView.getSettings().setUseWideViewPort(true);
        mWebView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
        mWebView.setWebViewClient(new MyWebViewClient());


    }
    private class MyWebViewClient extends WebViewClient {
        @Override
        public void onPageFinished(WebView view, String url) {
            super.onPageFinished(view, url);
        }

        @Override
        public void onReceivedSslError(WebView view, SslErrorHandler handler,
                SslError error) {
            Log.e("Error VAGARO", error.toString());
            handler.proceed();
        }

        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            view.loadUrl(url);
            return false;
        }
    }



}
like image 956
Manish Srivastava Avatar asked Dec 27 '13 14:12

Manish Srivastava


2 Answers

After one week struggle I got a Flash player from Macromedia, which works for me.

  1. You can search in Google for-"Flash Player 11.1.for Android 4.0 - Macromedia - Adobe" or install APK from this link.

  2. Install this apk in your Android device.

  3. And when you will open it, it will ask for choose default browser.

  4. Choose any browser which support Flash (UC-Browser, Chrome etc).

  5. Now run your any application it will load your Flash video.

like image 61
Manish Srivastava Avatar answered Nov 17 '22 07:11

Manish Srivastava


Add this code:

webview.getSettings().setPluginsEnabled(true);
like image 3
TheLittleNaruto Avatar answered Nov 17 '22 06:11

TheLittleNaruto