As the database in my app grows, it is going to require more and more of the internal phone space. There isn’t any sensitive/private data in the DB, so I’m interested in moving it to the SD card.
I’m using SQLiteOpenHelper to assist with the database work. It’s my understanding that you can’t use this for DB-access on the SD card as you can’t define the DB path. However, there are some (very poor) examples on the Internet that suggest you can override this limitation. However I’ve never gotten one of those code samples to compile.
Is it possible? And if so–HOW! Please note that Froyo’s “apps on SD card” feature won’t work as it doesn’t move internal files.
Just use:
where DB_FULL_PATH can be a path to your sdcard, like /sdcard/mydatabase.db
Edit:
This is what I call in my application to access the database….
… and this is the db helper class I’m using, which in fact extends SQLiteOpenHelper, so you will still have everything you want from this class.