05-11-2012 10:38 AM
I try to store some data to the localStorage on the PlayBook. In this case roundabout 2.6 MB, For that amount the QUOTA_EXCEEDED_ERR error is raised and I have no clue why? I thought the limit is about 5 MB? And I hoped that the PlayBook would ask the user to give more memory to the app.
Is there a way to force more memory space for localStorage? 2.6 MB is not that much, and I expect much more data in some cases.
This is my piece of code, any help would be really much appreciated:
localStorage.removeItem("items"); localStorage.setItem("items", JSON.stringify(this.getItemsAll()));
Solved! Go to Solution.
05-11-2012 03:29 PM
Hello, the current max size is in fact 5Mb. From the sounds of it, you estimate you are using about 1/2 of that. Could it be that the character encoding being used is using 2 bytes per character? e.g. the string "Hello World" in UTF-8 uses 22 bytes, not 11.
I was curious about this myself when I first started playing around with local storage and so created the following "load test" to explore what the upper limit was.
The way I found that limit was to keep pressing the "Load Local storage" button until nothing happens. Then remote one of the zeros in the input field and try again. Keep repeating this until you get to "1" being in the input field
05-11-2012 04:55 PM
Thanks for your ultra fast response and you are completely right. Thanks for the link, I tested it successfully on my PlayBook. **bleep**, I didn't even thought about the space needed by UTF-8.
So I will need another storage type for sure, but now I will be able to provide a bugfixed version for the affected app. Thanks again, great support!