android - Lose saved data on app update -
when creating new version of unity3d app, tested sideloading new version on top of from-the-store install. sideloaded app no longer able find files saved from-the-store version.
it seems though issue application.persistentdatapath differs between 2 app versions.
under buildsettings:
install location: prefer external write access: internal
the androidmanifest.xml seems have no information install location/write access location.
i wouldn't mind changing install location force internal, if helps update and/or in future. unsure setting does.
i'm saving xml files using c#'s xmlserializer , writing them filestream using application.persistentdatapath.
xmlserializer serializer = new xmlserializer(typeof([class])); filestream stream = new filestream( application.persistentdatapath + "/[filename].xml", filemode.create); serializer.serialize( stream, [object]); stream.close();
you can try saving xml string in playerprefs so:
playerprefs.setstring("savegamename", yourxml);
and so:
myxml = playerprefs.getstring("savegamename");
in past playerprefs class worked me persistent data. know fact data persists if install new versions app store.
http://docs.unity3d.com/scriptreference/playerprefs.html here docs on it.
Comments
Post a Comment