I have a HTML file in assets
folder of my project. And I load this file using webview as:
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setBuiltInZoomControls(true);
webView.setWebChromeClient(new WebChromeClient());
webView.loadUrl("file:///android_asset/index.html");
every thing works good.
But in some cases if I put some data in html with different character case then it not works in default webview but works in device browser (E.g Chrome):
E.g: I am trying to play a audio file using html as:
<html>
.
.
<audio id="mysound1" src="item/sounds/apple.mp3" autoplay></audio>
.
.
</html>
But in assets
folder I have file name as: Apple.mp3
If I load this html file in device browser then audio is playable, regardless there case in name. But if I try to load this html content in webview then this file is not playing. And I see a error in DDMS:
02-23 16:03:36.091: E/AndroidProtocolHandler(23303): Unable to open asset URL: file:///android_asset/item/sounds/apple.mp3
Can any one know about this behavior, how device browser load this file as there case in name is different. What should I do in webview to avoid this case sensitivity issue?