Skip to content Skip to sidebar Skip to footer

Android Database File Corruption

I've got an app that allows the user to save the app SQLite database files to the SD card. This function has been in place for over a year and has worked just fine. I've had users

Solution 1:

I also have an app with a (rather small) db and recently I get crash reports due to db problems that I could not reproduce.

Playing around with my app and really pushing it finally caused crashes.

The reason in my case was that due to many fast opening/closing/update requests, interruption of the app, language changes during the app, etc so the system somehow corrupted the db.

The solution I implemented now is

a. close/reopen the db often to avoid problems 

b. have a consistency-check routine for every save or retrieve of data now - lots of overhead - but that cleared it fo me so far...

ps I did not get the same crash report though as yours. I have now a couple of different Android phones on my desk for testing now and almost never got it to crash with the newest high-end ones. Those problems seem to happen more often with smaller memory/slower speed cpu phones than with fast high-end ones. - but honestly I am still confused about this! ... possibly the SD-card use is related to that too somehow?

Post a Comment for "Android Database File Corruption"