- Home /
Android Persistant Data
Hey,
Got an interesting issue with an android build. Currently testing a project on Kindle Fire, Nexus 10, and a Sony Xperia tablet.
Our project saves a lot of data via XmlSerialized files to the Application.persistentDataPath. This happens the same on our iOS build as well. On iOS and on the kindle fire, and the nexus this method works fine, the data saves and loads without issue next time you run the app.
However on the Xperia, we get an error when serializing the xml that access to the path is denied. We have the app set to read and write permissions for the SD card, and this is the same build as works on other tablets.
I thought perhaps the lack of a present SD card caused the issue, but even with an SD card in the issue remains.
Any ideas?
Have you tried checking the location you're writing to? It might be protected...
I'm not sure how informative errors are in the OSes mentioned, but another issue that'd prevent file writing might be your app attempting to write to the file before the OS registers it as closed, so a forced delay between file opening and writing might handle that?
protection would seem likely given the error, however its only the persistentDataPath which we use on all platforms for save data, and it works using this path on other droid devices. Also the files won't be open as this process is what creates the files in the first place on a fresh install.
Answer by FatWednesday · Jan 22, 2014 at 10:27 AM
Ok so issue seems solved now, Not sure what setting it was on the device (it's been suggested that enabling the device to install from non-google sources can put it into "read-only" mode) But after a factory reset this issue just disappeared.
Just posting this in case others face the same issue.
Your answer
Follow this Question
Related Questions
Loading/Saving XML not working on Android 1 Answer
Xml file not going in APK ... 1 Answer
How to modify or save xml on Android 0 Answers
StreamReader can't read Android internal storage path 0 Answers
Saving data 1 Answer