6

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;
        }
    }



}
5
  • 1
    flash is not supported on android anymore Commented Dec 27, 2013 at 14:57
  • @tyczj but when i use youtube video url its working fine why? Commented Dec 27, 2013 at 15:20
  • pretty sure android uses html5 for youtube videos Commented Dec 27, 2013 at 17:58
  • @tyczj so what should i do for my problem? I have to do it any how. Commented Dec 27, 2013 at 18:01
  • @tyczj Thanks Friend, finally I got solution. I got a flash apk which work for me. Commented Jan 4, 2014 at 19:45

3 Answers 3

7

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.

Sign up to request clarification or add additional context in comments.

1 Comment

I have the Flash apk already installed and it works in Dolphin. How can I manage to work it within a custom webview as well? setPluginState is assigned to ON.
3

Add this code:

webview.getSettings().setPluginsEnabled(true);

2 Comments

Thanks Friend, finally I got solution.
try this webview.getSettings().setPluginState(WebSettings.PluginState.ON);
-3

add mWebView.loadUrl(url);in onCreate

2 Comments

I try in my phone is ok .Do you run in phone ? And install flash ? If you want to html5,stackoverflow.com/questions/3815090/webview-and-html5-video can help you
Thanks Friend, finally I got solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.