我在 "Assets" 文件夹下有一个内部SQLite DB,其中我存储了100个用户名和相应的密码,如何通过phoneGap访问它 .
我读过了
-
http://docs.phonegap.com/en/1.6.1/cordova_storage_storage.md.html#Storage
-
connecting to sqlite database from phonegap html file for android
-
http://wiki.phonegap.com/w/page/16494756/Adding-SQL-Database-support-to-your-iPhone-App
我仍然无法弄清楚如何连接到已经创建的内部数据库,
dbname = userauth Tablename = reg parameters = usrnm , psw
任何答案都非常鼓励
Am using this here .
2 回答
那么,您可以将window.openDatabase()创建到assets文件夹中的数据库 . 您需要将其复制到正确的位置,以便WebView加载它 . 看看这个:
[http://gauravstomar.blogspot.ca/2011/08/prepopulate-sqlite-in-phonegap.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+GauravSTomarBootstrappingIntelligence+(Gaurav+S+Tomar+:+Bootstrapping+Intelligence](http://gauravstomar.blogspot.ca/2011/08/prepopulate-sqlite-in-phonegap.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+GauravSTomarBootstrappingIntelligence+(Gaurav+S+Tomar+:+Bootstrapping+Intelligence))
发布,因为Gaurav为您提供了在Android和iOS上执行此操作的代码 .