Oh my... when I think about that, I have a pretty old first generation 
Samsung Galaxy S (I9000). Its internal storage memory seems to be dying and 
quite a few apps behave erratically, including crashes and data loss. 
Sometimes it's stuck in an "infinite" reboot loop. So I'm pretty sure it 
won't last for too long.

I guess these are also probably things to watch out for when talking to 
customers (how old is their phone, do they store data on an external SD 
card, because these things can also break and silently corrupt your data. I 
lost a lot of photos and MP3s because of that :-)

It would be great if there were some system level tool for non-rooted 
devices to make a proper file system and storage integrity check...

On Wednesday, July 31, 2013 5:14:25 PM UTC-5, Kostya Vasilyev wrote:
>
>
>
> 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