Skip to content Skip to sidebar Skip to footer

Localstorage Limit On Phonegap

There is usually a limit of 5MB on localStorage on browsers, including iPhone's Safari. Since PhoneGap has the access higher security privileges including access to other storage m

Solution 1:

PhoneGap doesn't do anything out of the ordinary to extend the default limits. On Android, I get 2.5M characters in localStorage (Strings in JavaScript are UTF-16).

You can find default limits for most browsers here: http://dev-test.nemikor.com/web-storage/support-test/

This was helpful in understanding the limitations, and I used the code to create a simplified test PhoneGap app.

Solution 2:

PhoneGap has File API that should not be affected by browser local storage limits but don't know if there exist any abstraction to make it behave as HTML5 local storage "backend".

Solution 3:

If you want to store a large amount of data you should not do that in localStorage, there are databases and files for that kind of need. localStorage is a key-value datastore, it's use is limited and it should not be "hacked" to fit all needs.

Solution 4:

Localstorage is something which is provided by the browser.

Localstorage is not something which is available on a device, either a mobile phone or a desktop, that is leveraged by a browser.

Since it is something which the browser provides there is no way, we can change/increase it using Phonegap since your Phonegap app runs inside the browser.

If you want more storage space, you can use a technique which Phonegap can access like a file storage or SQlLite.

Post a Comment for "Localstorage Limit On Phonegap"