Android Question Database corrupted

luke2012

Well-Known Member
Licensed User
Longtime User
An Error has occurred in sub: main_vvvvvvvvvvvvvvvvvv2 (java line: 699) android.database.sqlite
SQLite databaseCorruptException: database disk image is malfromed: , while compliling: SELECT Name FROM tab_Ingredients where Name='Flag'
Continue?


A user that installed my app on Android 2.2 device got this error but in all my test (2.3, 4.0, 4.1, 4.2 and 4.4) I don't get this error.

Any Idea?
 

eps

Expert
Licensed User
Longtime User
I think you need to Google this issue. Just make sure that you are opening and closing the DB correctly, I think that it is a fairly commonly raised issue, but effectively it's a non-issue.

What I did was to check the DB in the Firefox add-on, which I think reported that it was fine. I also compacted the DB - but watch out as that can 'upset' any data already installed on Users devices, if the App writes data to the DB and they can sometimes lose data when they upgrade.

Some of the issues discussed here : http://stackoverflow.com/questions/2960015/android-database-disk-image-is-malformed

I think I made sure that all write transactions were begun and ended and also closed the DBs when the App is Exited. I don't think I've ever seen any more issues since then.

HTH
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
I think you need to Google this issue. Just make sure that you are opening and closing the DB correctly, I think that it is a fairly commonly raised issue, but effectively it's a non-issue.

What I did was to check the DB in the Firefox add-on, which I think reported that it was fine. I also compacted the DB - but watch out as that can 'upset' any data already installed on Users devices, if the App writes data to the DB and they can sometimes lose data when they upgrade.

Some of the issues discussed here : http://stackoverflow.com/questions/2960015/android-database-disk-image-is-malformed

I think I made sure that all write transactions were begun and ended and also closed the DBs when the App is Exited. I don't think I've ever seen any more issues since then.

HTH

I read somewhere that 2.2 had an issue if you named the file "something.db".
Change the .db extension to something else - like "something.xt"
 
Upvote 0

eps

Expert
Licensed User
Longtime User
I read somewhere that 2.2 had an issue if you named the file "something.db".
Change the .db extension to something else - like "something.xt"

This might also be the case, but then again how many 2.2 Users have the App in question installed? I think that 92% are on 2.3 or above. You'd be fixing a problem for 4% of the Users...
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
This might also be the case, but then again how many 2.2 Users have the App in question installed? I think that 92% are on 2.3 or above. You'd be fixing a problem for 4% of the Users...

Yes, I agree, but he did ask.... (I think it may have been 2.1 ver with this issue?)

If he is anywhere near as anal as I, one error on one device of 1000 installs would bug the crap out of me.... But then again - I fret too much.
2.3 is when things really started to stabilize...
 
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
This might also be the case, but then again how many 2.2 Users have the App in question installed? I think that 92% are on 2.3 or above. You'd be fixing a problem for 4% of the Users...

If I fix the issue for 4% of installed users and the real risk is to impact custom data of all other 96% users.
 
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
Yes, I agree, but he did ask.... (I think it may have been 2.1 ver with this issue?)

If he is anywhere near as anal as I, one error on one device of 1000 installs would bug the crap out of me.... But then again - I fret too much.
2.3 is when things really started to stabilize...

Thanks for your reply!
My very big problem is to respond to the user that is interested to my app but he don't able to use it in this moment.

User had installed the app on a LGM Tablet and LGM Smartphone both with Android 2.2.1.

So I think that I can esclude the SD corruption theory because is most probable that the problem is about Android Version ?
 
Upvote 0

eps

Expert
Licensed User
Longtime User
Thanks for your reply!
My very big problem is to respond to the user that is interested to my app but he don't able to use it in this moment.

User had installed the app on a LGM Tablet and LGM Smartphone both with Android 2.2.1.

So I think that I can esclude the SD corruption theory because is most probable that the problem is about Android Version ?

No, I think the issue is that Android 2.2 is more sensitive to DB Open, Close and Begin and End Transactions being in place, whereas the later versions are much improved in terms of not really needing these to be in place. I seem to remember having a similar issue, but it was around 2 years ago. The DB processing was made more explicit, as mentioned and afaik the problem hasn't reared it's head since.
 
Upvote 0
Top