【发布时间】:2012-02-07 05:57:43
【问题描述】:
我正在使用 phonegap 和 sqlite 开发适用于 android、ios、blackberry 的跨平台移动应用程序。作为参考,我使用的是 http://docs.phonegap.com/en/1.0.0/phonegap_storage_storage.md.html。我的 index.html 在下面
1.我在lib中有phonegap.jar
2.在assets/wwww中得到phonegap.js
3.在我的硬盘中下载了sqlite浏览器和sql shell
4.得到 jquery.min.js
我想知道如何从 index.html 中给出我的 sqlite 的位置,以便它可以与它建立连接。如果我只是传入 phonegap.js,它不会连接到 sqlite。
<head>
<title>Contact Example</title>
<script type="text/javascript" charset="utf-8" src="js/phonegap-1.4.0.js"> </script>
<script type="text/javascript" src="js/jquery.min.js"/></script>
<script type="text/javascript" src="js/jquery.mobile-1.0rc2.min.js"></script>
<script type="text/javascript" charset="utf-8">
function onLoad(){
document.addEventListener("deviceready", onDeviceReady, true);
var db = window.openDatabase("Dummy_DB", "3.0", "Just a Dummy DB",200000);
alert("db="+db); //not printing
}
function onDeviceReady(){
navigator.notification.alert("doo");//only printing this
}
<body onload="c()">
<h1>n Example</h1>
<p>Database</p>
</body>
【问题讨论】:
标签: android sqlite mobile cordova