0

I have a Phonegap / Cordova application which needs to bundle a SQLite database (about 7mb). I then wish to access that database using Javascript (jQuery mobile).

How do I approach this? I don't want to use HTML5 local storage as it does not have enough capacity and will be deleted after use. It has to be the native Android SQLite plus the javascript connectivity.

Thanks in advance!

Nick

Nick
  • 93
  • 1
  • 3
  • 8

2 Answers2

0

Last time I checked several months ago, it was imposible. Here is a similar question JavaScript sqlite, and this other one might be more useful http://luthfihariz.wordpress.com/2011/10/23/android-sqlite-phonegap-jquerymobile/

Community
  • 1
  • 1
CarlosJ
  • 244
  • 3
  • 13
0

Update I just found that it is possible to create SQLite database using phonegap, Read more here http://docs.phonegap.com/en/1.4.1/phonegap_storage_storage.md.html#Database

 window.openDatabase(name, version, display_name, size);

Hello you can make use of WebView, and use addJavascriptInterface(Object, String), this lets you use java methods from javascript. You can write methods to store, retrieve in java and later access them via javascript.

Raghav
  • 4,590
  • 1
  • 22
  • 32
  • this is not native SQLite but the WebSQL which is based on SQLite but not identical. – tkit Dec 14 '12 at 11:36