File persistence on uninstall (Application.persistentDataPath)
So, I've been using the Application.persistentDataPath as the storage for my games save files which works fine and updates don't mess with the files. However, on application uninstall the save files are wiped from the folder (the game is Android only at the moment). I'd like to make them persist. So, if the user decides to reinstall with a future update they'll still have the progress from their previous play time, and the files aren't very large. so that's not an issue.
Is there a way to make the files 'off-limits' to the folder wipe? Such as:
a sub-directory within the Application.persistentDataPath folder?
a new directory in the apps path other than 'files'?
some obscure Unity/Android option?
Or, should I move the save location to a completely new place outside of the persistentDataPath? If this is the better option, are there 'best practices' when mucking about with unmanaged directories in an Android system?
Answer by GamitusLabs · Oct 17, 2018 at 08:29 PM
Having done 2 days of Spider Man style web-crawling... mainly slinging myself from site-to-site with reckless abandon, I've come to the conclusion that there is no good answer for this out there. So, I'll experiment a bit for my next update. Cheers
Answer by feng19 · Jan 11, 2020 at 07:55 AM
I had same problem in last last game project. My solution is to integrate google cloud save into the game. Then you provide some UI interaction asking your users to save or load their game profiles. So even they uninstall and reinstall the game ,they can sync their profile from google cloud save.
I feel kind suck to do so, But it's a solution, I don't know, Maybe someone familier with Android could write an Android method to save game profile in a specified file out of Unity's domain.
Your answer
Follow this Question
Related Questions
Android PersistentDataPath UnauthorizedAccessException 0 Answers
I can't get Google cloud saving working 0 Answers
Tracking and Analysing Player's Choice 0 Answers
save data android with c# 0 Answers
Why is PlayerPrefs Not Working in Editor or Android? 0 Answers