android - difference between window.openDatabase() and window.sqlitePlugin.openDatabase() functions? -


using cordova version 3.x , android version 2.x 4.x.

i wondering:

  1. is understanding correct android devices default have sqlite program/interface creating sqlite database?
  2. do both above database function calls create sqlite database in device?
  3. if above answer no, type of database both above function calls create?
  4. if answer yes, window.sqlite.opendatabase() function wrapper around window.opendatabase()?
  5. are databases created call persistent? is, data available after closing , reopening cordova packaged apps?
  6. is there maximum database size can created above 2 methods?

  1. 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.

  1. yes both create db file path different. in fact can open same db javascript code , java code in app.

  2. same type of db. sqlite native c layer manages file structure. in fact, use native c api native android app.

  3. cordova / phonegap use sqlite built-in support if available (in android is).

  4. yes, stay there.

  5. yes, there's limit. check here more info.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -