- Home /
How can I save and read data on Android?
How can I save and read data on Android?
Answer by Ricardo Arango · Feb 11, 2011 at 10:52 AM
You can use the PlayerPrefs class of Unity to store Ints, Floats and Strings. The documentation for this is at: http://unity3d.com/support/documentation/ScriptReference/PlayerPrefs.html
If you need to store your own data types you can use System.IO classes of the .net (mono) library. The actual paths that you can use are located at Application.persistentDataPath and Application.temporaryCachePath.
You application needs to have permissions in the AndroidManifest.xml to write to storage. That can be set in Player Settings -> Android Tab -> Other Settings -> Configuration -> Force SD-Card permission.
I can't find the option to change the permissions in the new version of Unity. Does anybody know where it moved to?
There's a Write Permission, change it from Internal to External (SD card).
Your answer
Follow this Question
Related Questions
Dinamic name for data save 0 Answers
from bool array to binary file? 1 Answer
Save and Load in the build 0 Answers
How to save and load `List myList`? 1 Answer
IsolatedStorageException: Could not find a part of the path 1 Answer