title: Phonegap On Android 6 - How to get external storage path
body: <p>I'm trying to get external storage path in Phonegap. I'm using this code but it never handles the correct SDCard path.</p>
  
  <pre><code>(function(){
      window.appRootDirName = ".myapp";
      document.addEventListener("deviceready", onDeviceReady, false);
  
      function onDeviceReady() {
          alert(cordova.file.externalRootDirectory);
          console.log("device is ready");
          window.requestFileSystem  = window.requestFileSystem || window.webkitRequestFileSystem;
          window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
      }
  
      function fail() {
          console.log("failed to get filesystem");
      }
  
      function gotFS(fileSystem) {
          console.log("filesystem got");
          fileSystem.root.getDirectory(window.appRootDirName, {
              create : true,
              exclusive : false
          }, dirReady, fail);
      }
  
      function dirReady(entry) {
          window.appRootDir = entry;
          alert(JSON.stringify(window.appRootDir));
      }
  })();
  </code></pre>
  
  <p>also </p>
  
  <pre><code>&lt;preference name="AndroidPersistentFileLocation" value="Internal" /&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;preference name="AndroidPersistentFileLocation" value="Emulated" /&gt;
  </code></pre>
  
  <p>doesn't help.</p>
  
  <p>Are there a way to get the correct SDCard path on Android 6 with phonegap?</p>