In a normal Android web app the maximum size for a WebSQL database is normally around 8MB. In a hybrid web app I am making I would like to increase this limit. How would I go about doing that?
It seems that WebStorage might have something to do with it, but the only method I can see there that seems to set the size, setQuotaForOrigin
, is marked deprecated.
Sample code (that is not deprecated) is welcome :)
The quota for a web app seems to differ from that of a hybrid app (as in something running within a view). Regardless, by implementing the following in your
android.app.Activity
subclass you will double the quota until it finally stops at approximately 48MB.The user will not be asked to interact when this happens.
You may want to look at this other question on how to increase quota limit.
Looks like changing the size is only a problem for users that already have a local DB created, this is because there is no way to change the size of the DB when running upgrade scripts for versioning. That said, you just only need to change the size in the initialization script (code in JavaScript):
Take into account that this will only affect new users. All users that have previously created a DB with a different size need to clear their cache (you have controll of the cache on a webView so its not that bad) but all previous data would be lost (unless you manually migrate it to the new DB with native code). In my case I have to do the same but decreasing the size. That would take care of the issue.
Hope this helps.