我的代码如下是Android的简单钛移动应用程序。我实现了数据库来创建一个表。但我写的代码不适合我。我也在资源文件夹中创建了db文件。但是数据库没有变化。我的代码连接数据库是否正确?有人请验证我的代码并回答我的查询。无法访问钛移动数据库
var win = Ti.UI.createWindow({
title:'Window',
backgroundColor:'black',
borderColor:'grey'
});
var label1 = Ti.UI.createLabel({
text:'Welcome to new Window',
color:'white',
font:{fontSize:20},
top:10
});
var text1 = Ti.UI.createTextField({
top:50,width:200
});
var text2 = Ti.UI.createTextField({
top:100,width:200
});
var db = Titanium.Database.open('testdb');
db.execute('INSERT INTO tips (title, tip) VALUES(?,?)','santhosh','sathya');
db.close();
win.add(label1);
win.add(text1);
win.add(text2);
win.open({fullscreen:false});