Android cannot play flash in browser development using webview

Source: Internet
Author: User

You can use the browser that comes with the system to successfully play the flash, but you cannot play the flash with your own development.

CodeAs follows:
Browser = (webview) findviewbyid (R. Id. webview );
Browser. getsettings (). setjavascriptenabled (true );
Browser. getsettings (). setpluginsenabled (true );
Browser. getsettings (). setallowfileaccess (true );
Browser. getsettings (). setpluginsenabled (true );
Browser. getsettings (). setpluginstate (pluginstate. On );
// Browser. getsettings (). setpluginspath ("/data/" + getpackagename () + "/app_plugins/"); // note
Browser. loadurl (URL );

The first thing that comes to mind when Flash cannot be loaded is that the latest Adobe Flash Player is not installed or its plug-in path cannot be read.
Updating Adobe Flash Player to the latest version that supports Android 4.0 (you can download and install the latest version on Google Play) still cannot solve the problem.
Will it be unable to read the plugin path, find the websettings object usage in Android Developers, and find that there is a method: setpluginspath () can be used to set the plugin path.
However, this method has been deprecated. There are also the following explanations:
This method is no longer used as plugins are loaded from their own APK via the system's Package Manager.
In this way, you cannot execute plugin.
Go to the Internet and find a solution. This is because hardware acceleration is required for playing Flash after Android 3.0. Add the following statement in <activity...> of androidmanifest:
Android: hardwareaccelerated = "true"
However, after I add a video, the video cannot be played. Find another method on the Internet, that is, when loading, Adobe's Flash Player creates a surfaceview in webview,
There is a delay between surfaceview display and flash loading, resulting in Flash loading failure. The author also provides the code to solve the problem. The URL is as follows:
Http://stackoverflow.com/questions/5095977/screen-blinking-when-using-a-webview-with-flash
According to the above URL, after modification, it still cannot be displayed, weeping .........
There are different opinions about how to continue searching on the Internet. There is also a saying that the hardware CPU architecture is not x86 and cannot be played. If it is a hardware problem, it will be totally desperate.
Simply write a simple web page display on your own. If it doesn't work, report it to your boss as soon as possible. unexpectedly, I can play it on my own !!!!!!!!
Confident reply is definitely a problem with the program or configuration file.
Comment out all irrelevant programs and cannot be displayed as usual. Comment out the content in the configuration file that you do not understand and find the reason!
There is a <supports-screens> label in androidmanifest, with one of the following:
Android: anydensity = "false"
A Bitmap operation-related setting. The default value is true. We recommend that you do not set it unless you want to operate the bitmap directly.
Now, the problem is solved temporarily. solution:
Add Android: hardwareaccelerated = "true"
Remove Android: anydensity = "false"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.