> is there anyway i can use ormlite to create db file in sdcard ?
Are you asking if there is a way ORMLite can create a database that can be stored to a SD card?
If so then I guess the answer is sure. You could use SQLite and then copy the database files over to the SD card when you are done. As far as I know, SD cards do not support a huge number of write operations so you would not want to perform all operations on the SD card but rather do it in memory or in temporary disk space and then copy the database to the SD card as one write operation.
Take a look at this URL about how to save from memory to disk in SQLite: http://www.sqlite.org/backup.html
gray
if you use the standard database helper, I'm not sure. Generally you just give it a name, and the db is added in the local db directory. You MAY be able to specify an absolute path to the sdcard. Like /sdcard/mydb
Had I to bet, that won't work, but you can try. If you just want a copy, you can copy the db file. Something like
/data/data/com.yourpackage/databases/dbname.db
Also, to get the SD card path, use Environment.get(forgot the name)
On Oct 22, 2010, at 6:15 AM, hadi wrote:
> is there anyway i can use ormlite to create db file in s...