Im developing a game for android but I noticed one bug that I cant solve:
I save the game progress to a file “X” the file size is 288 bytes and the last modification date after close the file is Z, after that, I remove the battery and I put it again, the first thing that I do is to read the file and I noticed that the file size now is 0 bytes and the last modification date is previous to Z =s.
I really don’t know who is changing my file.
Did you wait long enough (don’t know how long on android, more than 3 minutes at least) before removing the battery?
Android writes files to the flash only once every x seconds. If you want to make sure, your data is actually written to the flash, use the ‘fsync‘ command.