I have some trouble with installing a database with Ti.Database.install(). Here's what I'm doing:
- Open new default alloy project
Add some code to
controllers/index.js
so the file looks like thisvar db = Ti.Database.install('/testimusDB.sqlite', 'testimusDB'); var rs = db.execute('SELECT * FROM testimusTable'); db.close(); while (rs.isValidRow()) { var name = rs.fieldByName('name'); var age = rs.fieldByName('age'); alert(name + ' is ' + age + 'years old'); rs.next(); } rs.close(); $.index.open();
create a DB with FF Plugin SQLite Manager called testimusDB.sqlite and copy it to the REsources Folder of the Project
- Start the App via Titanium Studio on a Samsung S3
What I get is
Runtime Error: LOCATION: [101,19] ti:/invoker.js
MESSAGE: Uncaught Error: Resources/testimusDB.sqlite SOURCE: return
delegate.apply(invoker._thisObj_,args);
People with the same problem solved it by reducing the size of the DB (mine is 64 KB) or by using absolute path (I tried absolute-/relative- path and sqlite-/db-/sql- suffix). Any ideas how to solve this problem?