Android 4.2.2 Samsung tab3 - localStorage Html is not working

335 Views Asked by At

I am developing an Android Web app which shall use localStorage to store some strings and numbers. LocalStorage works great on IOS and WindowsPhone 8 devices. The values in my app are stored with really simple standard statements:

"localStorage.setItem("key", "wert"); and to retrieve them with
localStorage.getItem("key");"

On the eclipse simulator on the mac (nexus) its working fine, but i started testing on real devices like my new samsung Galaxy tab 3 with 4.2.2 on it, its not showing these values.

I can see that it stores the values (increasing the data when i check the App via Settings/Application etc) but it does not show anything when i try to get the values with "localStorage.getItem("key");"

I am using only one webview and i added the settings needed i learned here in stack overflow:

"webView.getSettings().setDomStorageEnabled(true);
webView.getSettings().setDatabaseEnabled(true);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
   webView.getSettings().setDatabasePath("/data/data/" + webView.getContext().getPackageName() + "/databases/");
}"

Unfortunately its still not working on the samsung galaxy tab 3. My question is if anybody has a similar experience with Android 4.2.2 and samsung galaxy tab devices and (that would be great) an idea for an easy solution or if i really had to go the hard way with sqllite etc.

1

There are 1 best solutions below

0
ralphb On

i think i found the answer. Android does not support localStorage between different pages, thats...sad. I will try this here: https://github.com/didimoo/AndroidLocalStorage