[Arriba] [Todas las Listas]

[no subject]

To: android-developers@xxxxxxxxxxxxxxxx
From: Mathias Lin <mail@xxxxxxxxxxxxxx>
Date: Tue, 30 Sep 2014 17:35:33 -0700 (PDT)
Delivery-date: Tue, 30 Sep 2014 20:36:18 -0400
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120806; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type; bh=FxVxJP4OHDROJtaWslr/4btPWCyS3N39XgX+6fD4Wa4=; b=RdbV7j6e6ZaUM+Q+jRJ4Wlqow1/oUc9cSauk2NmavvwsM3Gk7Hh7tgjD7NkaR++S2A Yr70I6t2v5NgrTDEefiitu3FHdxT9sGocupBH/gHiR2KSeCGdxmCqQ/VaTo/4UCKG0c5 lHUksJ5vPadZ76wFVq3++ZpGZ+VSnqyWGFK4bAZN3xhBSSmET0TlIGryRLKQMAg/vvRn /qZGmDq8IFaEN2sIxsbau4xv8r5a8eyEv8Kwwuo/rBlxd0W0wDnw0H2IDuufN87r6Vcy /rUWVYSsZA/QFEw8R5zis5kYsRQYks8rCDLlIm4YgvXCi+wNZJcJqvl2NfK4uRtlP05V aqhw==
Envelope-to: traductor@xxxxxxxxxxx
In-reply-to: <>
List-archive: <>
List-help: <>, <>
List-id: <>
List-post: <>, <>
List-subscribe: <>, <>
List-unsubscribe: <>, <>
Mailing-list: list android-developers@xxxxxxxxxxxxxxxx; contact android-developers+owners@xxxxxxxxxxxxxxxx
References: <>
Reply-to: android-developers@xxxxxxxxxxxxxxxx
Sender: android-developers@xxxxxxxxxxxxxxxx

Update: Storing and loading the value from localStorage works fine on all 
devices while on the *same page*, however, not between different pages. In 
my example, I can store and retrieve the value on 01_home.html, but when I 
go to another page in the android_asset folder, I cannot retrieve it 
anymore (on LG and Samsung device). Works fine on Nexus 4 though.

What is the reason for the different behaviour? Different WebKit version, 
different Android version, vendor?

On Tuesday, 30 September 2014 11:56:11 UTC+2, Mathias Lin wrote:
> I have a html5 application that I wrap in a WebView. To store and retrieve 
> user input values between pages, I use the *localStorage* html5 feature.
> It works fine on my Nexus 4 (Android 4.4.4), but it does not work on 
> Samsung Galaxy Tab 2 (Android 4.3.x) (= nothing happens, but also no error 
> in logcat). Or, to be more clear: *on Samsung, it does not work if the 
> html pages are loaded from within the app's asset folder*. It does work 
> though if I put the pages on a web server, as below in the outcommented 
> line.
> However, on Nexus 4, loading from file:///android_asset/ and also if I 
> load the pages on a desktop browser (Chrome, Firefox) from file:// path, it 
> is also working.
> (I had another user reported the issue on a LG device, so it does not seem 
> to be Samsung specific).
> Below are the settings of the web view.
>     webView = (WebView)this.findViewById(;
>     webViewClient = new MyWebViewClient(this);
>     webViewClient.setSm(sm);
>     webView.setWebViewClient(webViewClient);
>     WebSettings webSettings = webView.getSettings();
>     webSettings.setJavaScriptEnabled(true);
>     webSettings.setDomStorageEnabled(true);
>     webView.getSettings().setJavaScriptEnabled(true);
>     webView.getSettings().setDomStorageEnabled(true);
>     webView.getSettings().setPluginState(WebSettings.PluginState.ON);
>     webView.getSettings().setAppCacheEnabled(false);
>     webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
>     webView.getSettings().setUseWideViewPort(true);
>     webView.getSettings().setLoadWithOverviewMode(true);
>     webView.getSettings().setBuiltInZoomControls(false);
>     webView.getSettings().setSupportZoom(false);
>     webView.getSettings().setDefaultZoom(WebSettings.ZoomDensity.FAR);
>     webView.loadUrl("file:///android_asset/01_home.html"); // does NOT work!
>     // webView.loadUrl("";); // does work!
> Local storage code in the pages:
> // storingvar data = document.getElementById('data').value;
> window.localStorage.setItem((1), data);
> // reading
> document.getElementById('data').value = window.localStorage.getItem(1);

You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
For more options, visit this group at
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@xxxxxxxxxxxxxxxx.
For more options, visit
<Anterior por Tema] Tema Actual [Siguiente por Tema>