title: How to create a file in Android, save it in the Download folder and show the file download notification in the notification bar?
body: <p>I am developing an Android app where I have to create an Excel file containing user reports, save the file in the Downloads folder or create my own apps directory in internal memory (because not everyone carries an external SD card), and show the file download notification in the notification bar where the user is taken to respective directory after tapping it.</p>
  
  <p>Now, I've tried creating directory and saving files successfully but it's not visible in the Android phone.</p>
  
  <p>The code that I used till now:</p>
  
  <pre><code>boolean success = false;
  File sub = new File(Environment.getExternalStorageDirectory(), "a5");
  if (!sub.exists())
  {
  
      success =  sub.mkdirs();
      Log.d(TAG,"!sub.exists() and success: " + success);
  }
  Log.d(TAG,"Folder 1 path: " + sub.toString());
  </code></pre>
  
  <p>which creates a folder at "/storage/emulated/0/a5". I also tried:</p>
  
  <pre><code> File sub = new File(context.getFilesDir(), "a5");
  </code></pre>
  
  <p>and</p>
  
  <pre><code>File sub = new File(Environment.getDataDirectory(), "a5");
  </code></pre>
  
  <p>but I couldn't see the folder in the Android phone by connecting it to the PC.</p>
  
  <p>So, my question is:</p>
  
  <ol>
  <li><p>How can I create a folder in the phone's internal memory just like apps like WhatsApp do, or,</p></li>
  <li><p>Create an app folder inside "\Internal storage\Android\data" directory, or,</p></li>
  <li><p>Save the file inside download folder just like web browsers save the downloaded file.</p></li>
  </ol>