After the use uninstall/reinstalls my app, all of his serialized data is gone. Is there a way to store a file on a mobile device permanently - which persists through various installs? Without using a server/cloud service or requiring the user to log into Google Play Games?
For those reading, I found this genius piece of code (first snippet): https://forum.unity3d.com/threads/load-video-files-from-sd-card.477593/ which I used to write my data to the phone's sdcard. It remained after completely un- and re-installing the app! Eureka! Now only to figure out how to do this on IOS...
UPDATE: still haven't tried IOS but improved it so it works with Internal Memory and no sdcard (but you need "Write External Storage" permission still for some reason):
string s = Directory.GetParent( Directory.GetParent(Application.persistentDataPath) .Parent.Parent.FullName).FullName; if (!Directory.Exists(s + "/.GAMENAME/")) Directory.CreateDirectory(s + "/.GAMENAME/"); myPath = s + "/.GAMENAME/GAMENAME.save";
Generally, the answer isn't that you can't, it's that you shouldn't create application specific data on a device that remains after removing the application. Otherwise the data of previous apps will uselessly stay on the device indefinitely, until it slowly fills up all of the device's storage. This is extremely bad form and may result in your app being rejected from the store.
You need to distinguish between files that belong to the device, such as music, photos, ... , and files that belong to the application, such as savegames. This applies regardless of mobile or not. The convention on desktop OSes is that during uninstall you ask the user if they want to keep their savegames.
How to do store data on the device is OS specific, so for an actual example you'll need to specify the OS.