- Home /
How do you enable saving on android?
I'm able to save all and any data I wish on multiple OS's however if I transfer the content on to an Android device the game will run perfect but my data isn't saved.
Do I have to enable something android specific for it to save data?
If I install the app on an android device it states that the app has permission to save data so I can't see where I am going wrong.
In my (admittedly limited) experience, saving data using PlayerPrefs in Android works exactly the same as on other devices.
Answer by MrSkiz · Nov 04, 2013 at 04:34 PM
Yes PlayerPrefs work on Android, I can set ints and strings on my project at runtime, and get them in another run.
But on Android PlayerPrefs are stored on an area of the device's memory not accessible if the device isn't rooted, so I think you can't simply copy/paste saved datas from one platform to Android.
So if your plan is to import datas from another platform, you should consider export these as text files or such and parse them at runtime in your Android build.
On Android, external files are/can be stored on "Your Device/Internal Memory/Android/data/com.[Your Company Name].[Your App Name]/files" (well at least it's the path for my HTC One X)
Don't forget that PlayerPrefs are also resetted each time you rebuild/reinstall the apk.
I've been saving my data as a custom class and not using PlayerPrefs, forgot all about them in fact. I'm now using a combination of PlayerPrefs and my custom class save method and it works perfectly.