I have a very strange problem with HTML5 LocalStorage in my Phonegap Android application. Maybe you will be able to help me.
I'm trying to use LocalStorage in my application but for some reason Android doesn't remember the LocalStorage values after I close the application (close it completely, not leave the app in the background).
In order to debug where the problem is, I started a new blank Android Phonegap 2.6.0 project (using the "create" command), and I use this JS code inside the "deviceready" event (this is the only change I did in the project):
alert("test:" + localStorage.getItem("test"));
localStorage.setItem("test","val");
But always when I close the application and open it again, I get a wrong "test:null" alert instead of "test:val", as it should be (should be saved in the LocalStorage).
Do you know what can be the problem? Why is the LocalStorage not working for me even on the example project of Phonegap 2.6.0?
BTW, I run the project on the emulator in Eclipse.
Thanks in advance,
Asif.