android - difference between window.openDatabase() and window.sqlitePlugin.openDatabase() functions? -
using cordova version 3.x , android version 2.x 4.x.
i wondering:
- is understanding correct android devices default have sqlite program/interface creating sqlite database?
- do both above database function calls create sqlite database in device?
- if above answer no, type of database both above function calls create?
- if answer yes,
window.sqlite.opendatabase()
function wrapper aroundwindow.opendatabase()
? - are databases created call persistent? is, data available after closing , reopening cordova packaged apps?
- is there maximum database size can created above 2 methods?
- websql (
window.opendatabase
) deprecated web standard. available in desktop , mobile browsers. browsers implement specification using sqlite. in android, browsers , webviews support websql, along local storage , session storage first versions, , indexeddb since kitkat.
then have android independently supports sqlite used java apis 1 of main persistence mechanisms.
cordova special. app runs in webview should using websql, in android plugin overrides api , implants window object new functions might default different implementation, rather browser api.
so in cordova app, once loaded, when call opendatabase
calling new function cordova has placed in windows object overriding old standard one. cordova docs:
some devices provide implementation of spec. devices, built-in support used instead of replacing cordova's implementation. devices don't have storage support, cordova's implementation should compatible w3c specification.
that quote ambiguous , no longer in docs. "built-in" meant built-in websql support in webview. docs linked old, 2.x version. in versions, cordova defaulted custom implementation if webview did not support websql (i think never happened) or if device affected bug 16175. default implementation consisted on using storage.java
plugin used java api create sqlite database. i've been reading most recent sources , on newer (3.x) versions seem using websqlite always.
yes both create db file path different. in fact can open same db javascript code , java code in app.
same type of db. sqlite native c layer manages file structure. in fact, use native c api native android app.
cordova / phonegap use sqlite built-in support if available (in android is).
yes, stay there.
yes, there's limit. check here more info.
Comments
Post a Comment