I have an app made with unity c# and I need to read a .txt file from de Download folder in android. I search the question everywere but cannot find anything. I went through many forums and they all talk about the persistentDataPath and dataPath but thats not what I need because you cant manually access to them. I already have the scrip to get the dowloand folder path and for read the .txt file. Works fine on unity/windows the script find the download folder and read the .txt but when I run the app on android I cant read the .txt file. I read somewhere that ReadAllText() doesnt work in Android, I tried Resource.Load() and TextAsset but doesnt work neither. I spend the last two days searching for answer but didn't find anything, just people with the same problem and no solutions. Sorry if I add some wrong tag or did something wrong in anyway, tis the first question I do here. Thanks in advance
This is the code that im using to obtain the Download folder path
private static string GetDownloadFolder()
{
string[] temp = (Application.persistentDataPath.Replace("Android", "")).Split(new string[] { "//" }, System.StringSplitOptions.None);
return (temp[0] + "/Download");
}
And this is how i read the .txt file (only works on windows and unity editor)
private string[] ReadTxt(string path)
{
string[] lineas = null;
path += "/Cuentas.txt";
lineas = System.IO.File.ReadAllLines(path);
return lineas;
}