title: Android - internal data save getFilesDir()?
body: <p>I am downloading from web and APK update file with this code:</p>
  
  <pre><code>        URL url = new URL(urls[0]);
          HttpURLConnection connection2 = (HttpURLConnection) url.openConnection();
          connection2.setRequestMethod("GET");
          connection2.setDoOutput(true);
          connection2.connect();
          int lenghtOfFile = connection2.getContentLength();
  
          String PATH = ctx.getFilesDir()+"/";
          File apkdir=new File (PATH);
          apkdir.mkdirs();
          File newInstall=new File(apkdir, "app.apk");
  
          InputStream input = new BufferedInputStream(url.openStream());
          OutputStream output = new FileOutputStream(newInstall);
  
          byte data[] = new byte[1024];
  
          long total = 0;
  
          while ((count = input.read(data)) != -1) {
              total += count;
              publishProgress((int)(total*100/lenghtOfFile));
              prog=(int)(total*100/lenghtOfFile);
              output.write(data, 0, count);
          }
  
          output.flush();
          output.close();
          input.close();
      } catch (Exception e) {}
  
      return null;
  </code></pre>
  
  <p>and for opening file I use this:</p>
  
  <pre><code>    Intent install=new Intent(Intent.ACTION_VIEW);
      install.setDataAndType(Uri.fromFile(new File(ctx.getFilesDir()+"/app.apk")), "application/vnd.android.package-archive");
  </code></pre>
  
  <p>And here comes the problem - I am ablte to store downloaded app into Context.getFilesDir(), but when I prompt installation pricess, logcat says "unable to read androidmanifest.xml. Where do you see the problem? I need to download into internal, not accesible memory by user, because of security reasons.</p>