Reputation: 1
I have a web app that runs on earlier versions of Android but seems to have problems when run on Android 4.0.3 (HTC 1x) Namely the openDatabase javascript function is "undefined", is this api supported?
Upvotes: 0
Views: 1491
Reputation: 143
I think the answer to this question is "it depends on the device." I've been trying to solve the issue for a web app that's working fine on iOS and some Android devices, but not others, and we've seen issues with some 4.0.3, some 4.0.4, and some 2.3.x (so far, the one 2.2.x device we've tried worked fine). I've spent weeks trying to come up with a client-side solution, but I think there may be none. Strangely, manipulating the db version seems to change things somewhat in some devices, even if you aren't versioning the db, but it doesn't solve the problem. Neither does changing maxSize.
WebSQL is deprecated and who knows if it will continue to be supported across devices, so I think the best strategy is to use some kind of abstraction (like Lawnchair) or for now, go with localstorage/sessionstorage or, in the future indexedDB.
Upvotes: 3
Reputation: 7315
Yes, of course, I use it on Android 2.2 so I think 4.0.x is also compatible with it...
Can you post your Javascript code ?
var db = openDatabase(shortName, version, displayName, maxSize);
Upvotes: -1