I am so confused.
Around the internet there are 100 different document with a 100 different methods of getting a database to install and run in your app.
All I really want is the one sure fire way of getting a pre-exsiting sqlite database installed into the app,so the database is persistent (not killed every time I build).
I have looked at the kitchen sink, and the persistence example, both which use sql statements to build the table before working with the database.
Can someone please help me out? I have wasted half a day looking/reading/watching all I can on the internet to only be left with not being sure of what I really need to do to get a datbase working in my app.
My database is located in Resources/database/efdata.db and efdata.sqlite . I don't care which file is used, I was watching youTube and someone said appcelerator doesn't read sqlite files, so I renamed it.
Based on (http://developer.appcelerator.com/question/9161/how-to-test-persistent-storage) I think that I need to install the database and then open it from the app directory.
var efSonar = Ti.Database.install('/database/efdata.db', 'efdatav01'); efSonar.close(); var separator = Titanium.Filesystem.getSeparator(); var dbFile = Titanium.Filesystem.getFile(Titanium.Filesystem.getResourcesDirectory() + separator + "efdatav01"); var efSonar = Titanium.Database.open(dbFile);I get an error
Thanks for the help. I really would like to get this app off the ground.
var efSonar = Titanium.Database.open('efdatav01'); instead. No need to go get a file path or whatnot.
Think you can help? Login to answer this question!