title: Iterating and reading text files from folder on Android
body: <p>I made a word game app for android in Unity, where the player has to find a word from a category previously loaded to the game. </p>
  
  <p>The way I load the categories is:
  There is a folder named Categories, inside Assets, I run through the folder and read each text file as a category.</p>
  
  <p>The categories are stored in a dictionary where the key is name the of the file and the value is every line of the file as an array element.</p>
  
  <p>It worked well on the PC however no luck on android. Tried changing the path to 
  "public string categoriesDirectoryPath = Application.persistentDataPath +"Categories";" still does not work.</p>
  
  <p>Original path was "Assets/Categories"</p>
  
  <p>Code for initiating the dictionary with the file values is (Happens on GameManager's Awake()):</p>
  
  <pre><code> private Dictionary&lt;string, string[]&gt; createCategories(string directoryPath)
      {
          Dictionary&lt;string, string[]&gt; categories = new Dictionary&lt;string, string[]&gt;();
          string[] categoryPaths = Directory.GetFiles(directoryPath);
          foreach (string path in categoryPaths)
          {
              if (!path.EndsWith("meta")) {
                  Debug.Log(path);
                  string categoryName = Path.GetFileNameWithoutExtension(path);
                  Debug.Log(categoryName);
                  string[] categoryData = File.ReadAllLines(path).ToArray();
                  categories.Add(categoryName, categoryData);
              }
          }
          return categories;
      }
  </code></pre>
  
  <p>Is there a way of iterating the folder and reading the text files that were in Assets/Categories after building the APK?</p>