title: Read Downloaded Text File - Android
body: <p>So my program works like this:
  It downloads a .txt file from the dropbox and saves it to downloads directory.</p>
  
  <pre><code>Uri uri = Uri.parse(file);
  DownloadManager.Request r = new DownloadManager.Request(uri);
  
  // This put the download in the same Download dir the browser uses
  r.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, "upload");
  
  r.allowScanningByMediaScanner();
  
  // Start download
  DownloadManager dm = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);
  dm.enqueue(r);
  </code></pre>
  
  <p>And the code is working fine, it downloads the file called upload.txt.
  So now i want to read from it. I have been looking for some codes and nothing seems to be working...<br>
  Here is my current code, it throws a FileNotFoundException but file is located there.<br>
  Any tips?</p>
  
  <pre><code>String text="";
      FileInputStream Fin=new FileInputStream(Environment.DIRECTORY_DOWNLOADS+"upload");
      byte[] b=new byte[100];
      Fin.read(b);
      text=new String(b);
      Fin.close();
  </code></pre>
  
  <p>Ofc i have tried putting "upload.txt", and even "/upload" and "/upload.txt" but still nothing.<br>
  If anyone can give me code that reads a text file, it would be awesome, or if someone could give me a code that can get the source code form a html site ( without JSOUP and other parsers, i have tried that, i want to implement my own parser ).
  Thanks!!</p>