I. BACKGROUND
1, recently in doing a Android side play Flash application, Android device does not have a screen, the display needs to be connected via HDMI. The interaction between JavaScript and Java needs to be used, and the Android side receives flash-transmitted Fscommand.
2, want to load HTML through WebView implementation
Second, encounter problems
1, through the HTML after loading the animation, regardless of which button, the SWF file can not receive the key message, it can not implement some of its own operational features
2, sent over the command received (there is time to analyze this, has been resolved)
Iii. Methods of trial
1, found that if directly through the computer side using the browser to open the HTML, directly tapping the keyboard is not effective, mouse click, the button has effect
2, did not receive the command, by adding the Flash security sandbox path can, of course, you have to install Flash Player
3, by guessing that should be webview start time did not get to the focus, so the key event has not been captured
Iv. Successful Solution
1. HTML Loading main.swf
<! DOCTYPE HTML PUBLIC "-//wapforum//dtd XHTML Mobile 1.0//en" "Http://www.wapforum.org/DTD/xhtml-mobile10.dtd" >< HTML xmlns= "http://www.w3.org/1999/xhtml" >
whichWidth= "100%" height= "100%"
This is based on the device full screen, for different resolutions of different screen size devices, this property is necessary2, Analog Click event, you can add the following code after the HTML loaded successfully
Mwebview.dispatchtouchevent (Motionevent.obtain (Systemclock.uptimemillis (), Systemclock.uptimemillis (), Motionevent.action_down, Mwebview.getleft () + 5,mwebview.gettop () + 5, 0); Mwebview.dispatchtouchevent ( Motionevent.obtain (Systemclock.uptimemillis (), Systemclock.uptimemillis (), MOTIONEVENT.ACTION_UP, Mwebview.getleft () + 5,mwebview.gettop () + 5, 0));
3, add a secure path to the Android side, so far to achieve the desired effect