title: Installing application after download: `There is a p‌r‌o‌b‌l‌e‌m parsing the package`
body: <p>I am trying to <strong>download an install</strong> a .apk file from an application. Here are 3 different situations:</p>
  
  <p><strong>1.</strong> From Eclipse to Tablet via adb <strong>></strong> Run application <strong>></strong> No problems<br>
  <strong>2.</strong> From Eclipse <strong>></strong> Sign &amp; Export <strong>></strong> Transfer .apk file to tablet via USB <strong>></strong> Install &amp; Run application <strong>></strong> No problems<br>
  <strong>3.</strong> From Eclipse <strong>></strong> Sign &amp; Export <strong>></strong> (The same file from 2.) Upload .apk file to a server <strong>></strong> Download .apk file from application <strong>></strong> Try to install <strong>></strong> "There is a problem parsing the package"</p>
  
  <p><strong>code for downloading the application:</strong></p>
  
  <pre><code>private class DownloadFile extends AsyncTask&lt;String, Integer, String&gt; {
      @Override
      protected String doInBackground(String... sUrl) {
          try {
              URL url = new URL(sUrl[0]);
              URLConnection connection = url.openConnection();
              connection.connect();
              // this will be useful so that you can show a typical 0-100% progress bar
              int fileLength = connection.getContentLength();
  
              // download the file
              InputStream input = new BufferedInputStream(url.openStream());
              OutputStream output = new FileOutputStream(Environment.getExternalStorageDirectory() + File.separator + "Download" + File.separator + "Design102.apk");
  
              byte data[] = new byte[1024];
              long total = 0;
              int count;
              while ((count = input.read(data)) != -1) {
                  total += count;
                  // publishing the progress....
                  publishProgress((int) (total * 100 / fileLength));
                  output.write(data, 0, count);
              }
              output.flush();
              output.close();
              input.close();
  
          } catch (Exception e) {
              e.printStackTrace();
          }
          return null;
      }
  }
  </code></pre>
  
  <p>Why am I getting "There is a problem parsing the package" error for the same .apk file after downloading?</p>