问题
I am building mobile app using phonegap and am using Phonegap 2.9.0 version and SQLite Plugin from the https://github.com/pgsqlite/PG-SQLitePlugin-Android.
I have include below js file in index.html,
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" charset="utf-8" src="SQLitePlugin.js"></script>
then calling below method in deviceready event,
var db = window.sqlitePlugin.openDatabase("test.db", "1.0", "test", 20000);
I have also copy the test.db Database to this folder "/data/data/"+pName+"/databases/".
I have followed exact steps given in above site but dont know something still missing and SQLite Plugin not working.
Please help me and if anyone have example then its better for me to understand.
Regards
回答1:
Please change your code line to
var db = window.openDatabase("test.db", "1.0", "test", 20000);
instead of
var db = window.sqlitePlugin.openDatabase("test.db", "1.0", "test", 20000);
来源:https://stackoverflow.com/questions/17653809/how-to-install-sqlite-plugin-in-android-ios-in-phonegap