Working with prepopulated sqlite database in phonegap android

后端 未结 2 441
太阳男子
太阳男子 2020-12-07 06:30

I have an sqlite database test_db.db i have kept in the www folder i am using cordova cli to build android app on my local machine.

when i am trying to open the data

2条回答
  •  独厮守ぢ
    2020-12-07 06:46

    Hello I got the solution for this question.

    while opening the database in the folling code

    var db = window.sqlitePlugin.openDatabase({ name : "test_db.db" });

    Add a parameter like this

    var db = window.sqlitePlugin.openDatabase({ name : "test_db.db", createFromLocation : 1 });

    Then it will take the database which you have kept in the www folder.

提交回复
热议问题