I have an app that previously was created using Xamarin (for Android) and it is now re-created using Unity. During the upgrade process I like to read files created by the previous version but have problems getting the correct data path without hard coding it.
I guess I’m supposed to save files using Application.persistentDataPath in Unity and I have no problem with that. The problem is that the previous (Xamarin) version saved files at System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal) which is a completely different path.
persistentDataPath is “/storage/emulated/0/Android/data/…” while
SpecialFolder.Personal is “/data/user/0/…”
if I make the call System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal) in Unity, I only get “/” as result, not the complete path as I get when calling it from Xamarin.
I can read the files if I hard code the path but I don’t want to do that. Is there any way to get the SpecialFolder.Personal path (referencing “/data/user/0/…”) in Unity?