Am trying to play local .swf files (kept in asset or sdcard) inside webview. But am not getting any luck...Can anyone guide me the proper way??? I am able to play swf files
For assets:
webView.loadUrl("file:///android_asset/YourFile.swf");
will play the file auto-scaled to the WebView size.
For the SD card, I expect something like this would work:
if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)){
Log.d(TAG, "No SDCard");
} else {
webView.loadUrl("file://" + Environment.getExternalStorageDirectory() + "/YourPath/YourFile.swf");
}
(Using the READ_EXTERNAL_STORAGE permission, of course).
Edit: You may also need to set:
webView.getSettings().setAllowFileAccess(true);