title: Android APK installs manually but not programmatically
body: <p>I have written an app that is designed to download an .apk and install it.  while the download seems to execute, the installation errors out with a parse error.</p>
  
  <p>If I download the .apk manually from my repository in to the devices Download directory, I can install it without any problems.</p>
  
  <p>The relevant parts of the code are at an <a href="https://stackoverflow.com/questions/33808057/cordova-android-how-to-manually-access-persistent-file-location">earlier stack question I asked</a>.</p>
  
  <p>How can the same file not install when downloaded programmatically?</p>
  
  <p>[SOLVED] changed download location from</p>
  
  <pre><code>var toLocation = "cdvfile://localhost/persistent/" + file;
  </code></pre>
  
  <p>to</p>
  
  <pre><code>var toLocation = cordova.file.externalDataDirectory + file;
  </code></pre>