Question regarding file.dirinternal

jake

Member
Licensed User
Longtime User
I know this is a simple question but I just want to be sure...

If I create a file with user data in file.dirinternal, is it going to disappear when the if the apk gets updated?:sign0104:
 

jake

Member
Licensed User
Longtime User
Thanks Maragret.

I'll have to look more closely at my code, because currently my data is disappearing.
 
Upvote 0

jake

Member
Licensed User
Longtime User
Well I got to the bottom of how a users data disappeared upon update of my app. I've learned that the problem was due to storing user data to a file within file.dirDefaultExternal.

I've learned that this default directory under particular circumstances can get deleted when the apk is updated. This is particular apparently to some devices running Android 2.2. A post regarding this can be found here Data/files erase on installation

So I have at least one case where if I put out a new apk update to fix this bug, it will with certainty cause user data to get deleted. Unfortunate because it injures my credibility. I warn others because if your testing device isn't 2.2(froyo) you wouldn't have any idea that putting a persistent file within file.dirDefaultExternal can have consequences.

To fix this issue I will copy the files stored in the defaultExternal to a custom directory and no longer use the file.dirDefaultExternal directory.
 
Upvote 0
Top