- Home /
What is the best way to save data on Android?
Hey!
I'm making a game on Android and I need to save two boolean variables (completed and unlocked) for each level of my game. I've seen a lot of different methods of saving data and I want to know which method is the best for what I'm trying to do.
I have a GameLevel class for each level that stores the two boolean variables and a LevelManager class that stores an array of GameLevel objects. I need to save the contents of the array each time the game closes and load it again when it opens.
PlayerPrefs looks easy to use, but I've read that it saves it's files as text files that can be easily altered. Is this true on Mobile devices as well?
Thanks for your help!
if you just want to save single values the best method is to use the PlayerPrefs.
But if you want to save a class: Save and load it with Streamreader/Streamwriter
Of course you can edit the files in both ways (e. g. with iFunBox(iOS))
Your answer
Follow this Question
Related Questions
Saving and loading data from file 0 Answers
C# Issues with either PlayerPrefs.SetVariable or UnityEvent.Invoke 1 Answer
How do I find a Prefab after I Replaced said Prefab? 1 Answer
Cannot load a saved game 1 Answer
Saving/Load using menu C# 1 Answer