title: assets folder structure in cordova
body: <p>I'm trying to read the text file in cordova. For this I've created a <strong>assets</strong> folder (See the <em>cordova folder structure</em> image) and placed my text file in that but i'm getting the error <code>java.io.FileNotFoundException: json.txt</code>. </p>
  
  <p><strong>Note:</strong>
  When i tried it in the Android native I'm able to read the file...</p>
  
  <p><strong><em>Code</em></strong></p>
  
  <pre><code>String yourData = LoadData("json.txt");
  </code></pre>
  
  <hr>
  
  <pre><code>public String LoadData(String inFile) {
      String tContents = "";
  
      try {
          InputStream stream = context.getAssets().open(inFile);
  
          int size = stream.available();
          byte[] buffer = new byte[size];
          stream.read(buffer);
          stream.close();
          tContents = new String(buffer);
      } catch (IOException e) {
          e.printStackTrace();
          Log.e("catch", e + "");
      }
  
      return tContents;
  
  }
  </code></pre>
  
  <p><strong><em>Cordova folder structure</em></strong></p>
  
  <p><a href="https://i.stack.imgur.com/apEdz.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/apEdz.jpg" alt="enter image description here"></a></p>
  
  <p>Am i placing <strong>assets</strong> folder in the wrong position or am i doing any other mistake?</p>