On Thursday, August 1, 2013 2:01:29 AM UTC+4, Nathan wrote:
>
>
>  
>
>> In older Android versions that error was not treated gracefully and the 
>> database file could get corrupted. In newer versions you are greeted with 
>> an exception. When the database file gets corrupted, the default behavior 
>> of SQLiteDatabase is "silently" dropping the whole database file and 
>> creating a new one, so basically you start from scratch in such a situation 
>> and probably your table creation / setup routines kick in and start fresh.
>>
>
> Sounds horrible, and has probably happened to a few unfortunate users.  
>

Recent Android versions, too, have code to detect database being corrupted 
and then delete and re-create (the database obviously loses all its data). 
I see this happen in my app from time to time -- it's *extremely* rare and 
*extremely* unpleasant to the users. Not sure what the origin of the issue 
is - bugs in SQLite, or maybe flash memory going bad?

As for not opening the same file, have you considered File#getCanonicalPath?

http://developer.android.com/reference/java/io/File.html#getCanonicalFile()

Not sure if it'll properly resolve all those compatibility and profile 
specific memory card paths that ICS/JB have, but perhaps it's worth a try?

-- K
 

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to