Android 4.0.1 Breaks Webview HTML 5 Local Storage

Android 4.0.1 breaks WebView HTML 5 local storage?

Via some discussion with a Google engineer it seems that they've made the decision that the file:// scheme is insecure.

A work around for this is to do the following

browser.loadDataWithBaseURL("http://www.example.com", 
htmlContent,
"text/html",
"utf-8",
null);

Android 4.0 Webview Not Working Correctly

This is just a shot in the dark here, but it looks like your emulator requires you to call,

AdRequest adRequest = new AdRequest();
adRequest.addTestDevice(AdRequest.TEST_EMULATOR);

before calling,

adView.loadAd(adRequest);

Edit:

Read this and this. It looks like the Android team came to the decision that "file:///scheme" is insecure (beginning with 4.0).

Perhaps you could just upload the asset to dropbox (or somewhere online) instead and download the file at runtime.

Android 4.0 WebView.loadURL oddity

I updated last week from 2.3.4 to 4.0 on my HTC Sensation.
The two apps i wrote had a local HTML-Contact site.
On 2.3 it ran fine, now i get a "Webpage not available" site.

I found another post here on this site with the comment:
"Via some discussion with a Google engineer it seems that they've made the decision that the file:// scheme is insecure."

See here: Android 4.0.1 breaks WebView HTML 5 local storage?

Android 4.0.3, window.openDatabase doesn't work

According to http://androidforums.com/application-development/103644-why-doesnt-work-javascript-opendatabase-android.html, Android has had iffy support for window.OpenDatabase() method since the start. You may want to see this StackOverflow thread: Android 4.0.1 breaks WebView HTML 5 local storage?

jQuery Mobile not working in WebView when loading from local assets

Solved it myself. Turns out from JellyBean on, the webView settings include a property to disable loading from file resources, and it is disabled by default.

Running my app from a pre-Jelly device works fine, but the two devices I was using for development were both 4.3 based.

I solved it using the following code, if anyone is interested:

    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN){
s.setAllowUniversalAccessFromFileURLs(true);
s.setAllowFileAccessFromFileURLs(true);
}


Related Topics



Leave a reply



Submit