title: Android - creating custom directory to store files
body: <p>In my app, I am intending to store user generated files in a custom directory (that I intend to create) within the user's SD card storage. </p>
  
  <p>I am doing that using:</p>
  
  <pre><code>String pathToExternalStorage = Environment.getExternalStorageDirectory().toString();
  File appDirectory = new File(pathToExternalStorage + "/" + "AppName");
  // have the object build the directory structure, if needed.
  appDirectory.mkdirs();
  </code></pre>
  
  <p>Would you recommend taking this approach? Will this folder and files persist if the user deletes my application?</p>
  
  <p>Because, the Android documentation says:</p>
  
  <blockquote>
    <p>If you want to save files that are not specific to your application
    and that should not be deleted when your application is uninstalled,
    save them to one of the public directories on the external storage.
    These directories lay at the root of the external storage, such as
    Music/, Pictures/, Ringtones/, and others.</p>
  </blockquote>
  
  <p>I would need the files to persist even if the user uninstalls the app, but I did not wanted to clutter an existing folder my adding my files there - I thought creating a separate folder would be better. I am targetting API v9 and above.</p>