Thursday, January 15, 2009

Database on SD Card Idea

I had an idea for how to quickly get the database on SD card implimented and do so in a way where uses do NOT loose their data. I'll play around with that this weekend since it's one of the biggest items left on my 1.2.* hit-list.

The idea is pretty simple. I've know how to build the custom provider to read data from an SDCARD (well, the theory behind it), but I've stuggled with a way to do it such that the data from the old database is kept in the new database.

So what I intent to do is this... In the onUpgrade method, perform my necessary upgrade to the database on the device, then copy it to the new SDCARD location. Then, in the future, just read it from there. I'll probably run my export routine first just in case, but still... I don't know why I didn't think of that rather than the complicated query solutions I had tossed around before...

Thoank God for showers! If not for them, I would probably never have any ideas that could be considered remotely good!

1 comment:

  1. I am a HUGE fan of your app, My Collection!!! IT IS ZE BOMB! Thank you for providing such a useful and wonderful application. It's programmers like you that will make the G1 a successful platform.

    I did have an idea for you... just to consider, please don't take it as criticism. You check amazon for the UPC code... how about also... www.upcdatabase.com, if amazon fails to find anything. Just a thought. A fall back, if necessary.

    It might be asking too much, but it'd also be killer if you could attach the "barcode scan" function to the camera button, or some other button on the device. Would make scanning a little less of a hassle for all your users. Again, just a thought.

    Take care and keep up the good work. If you start charging for this app.. I'll happily be a loyal customer!

    ReplyDelete