I have an swf file I want to play on android, but since swf is not officially supported on android 4.0+, I'm using google swiffy to convert swf to html5. I have tried this code but it is not working, webview just showing white blank screen.
public class MainActivity extends AppCompatActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.webview);
WebView wv;
wv = (WebView) findViewById(R.id.webView1);
wv.getSettings().setJavaScriptEnabled(true);
wv.loadUrl("file:///android_asset/swiffy.html");
}
}
Swiffy code: https://www.dropbox.com/s/481mlqc8ym497q1/swiffy.html?dl=0
Untested at the moment but... I'm wondering if there's a security issue with your HTML (on local storage) trying to access an online file? If swiffy.html was online it might work normally, but since it's on storage then make sure the JS file is on same place in storage too.
The source of swiffy.html loads a
https://www.gstatic.com/swiffy/v7.4/runtime.jsPossible fix :
1) Save this JS file to the same place as your swiffy.html
2) Edit the source code of swiffy.html, change the line below...
To become like this...
Save as swiffy_v2.html and test that in your webView code as :
Edit from comments :
Another fix is to just add the allowing of internet access in the app's manifest file. This solves the issue of loading the online JS file from a local HTML file.