How to reference a filepath for streamreader on android device?
I am making a word game and trying to use a few .txt filex as csv dictionaries to reference. I am using a streamreader because I have CSVs and I am trying to read the file Line by Line.
A streamreader however, requires a datapath string to operate. In the editor this is fine. I can use a number of options to reference the file by path. However, none of them work when I build to an android device because the filepath becomes irrelevant and doesn't exist in that world.
I have tried: path = Path.Combine(Application.dataPath, filename); path = Path.Combine(Application.streamingAssetsPath, filename);
Resources.Load doesn't work because (as far as I know) I can't reference it as a datapath and if I load a TextAsset I can only convert that to a single string rather than read it line-by-line. So....how do I load these .txt files into my project and read them with a filestream? is there a path I can save them to? or is there an alternative to StreamReader that doesn't require a path?
PLEASE HELP
Your answer
Follow this Question
Related Questions
Why does Resources.Load keep returning null? 1 Answer
make list of questions from txt file and make it work in android. c# 1 Answer
Loading JSON as a Text Asset using Resources.Load 1 Answer
Web Build Text Assets Aren't Working 1 Answer
I get a message saying that the project path is invalid. 0 Answers