title: How to install APK automatically when the file download is complete (hosted on private)
body: <p>I am new to android and i have been searching the web from last two days for this. I found following links too but i am not getting how and where to implement this code to start automatic installation of the apk file after it downloads completely and how to delete the downloaded apk file after installation. Please help me by guiding me the right way.</p>
  
  <p><a href="https://stackoverflow.com/questions/5428853/how-to-install-apk-file-programmatically">how to install apk file programmatically</a></p>
  
  <p><a href="https://stackoverflow.com/questions/2702178/invoking-activity-from-apk-in-another-android-application">Invoking activity from APK in another android application</a></p>
  
  <p><a href="https://stackoverflow.com/questions/4768930/android-install-apk-programmatically">Android install apk programmatically</a></p>
  
  <p><a href="https://stackoverflow.com/questions/6362479/install-apk-programmatically-on-android">Install APK programmatically on android</a></p>
  
  <p><a href="http://www.anddev.org/viewtopic.php?p=23928" rel="noreferrer">http://www.anddev.org/viewtopic.php?p=23928</a></p>
  
  <p>EDIT :</p>
  
  <p>i have written this code in manifest file :</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
      &lt;uses-permission android:name="android.permission.WRITE_CONTACTS" /&gt;
      &lt;!-- &lt;uses-permission android:name="android.permission.INSTALL_PACKAGES"/&gt; --&gt;
      &lt;application android:icon="@drawable/biz_logo"
          android:permission="android.permission.WRITE_CONTACTS"&gt;
          &lt;activity android:name="com.biz.mlm.Main"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.VIEW" /&gt;
                  &lt;category android:name="android.intent.category.DEFAULT" /&gt;
                  &lt;data android:scheme="content" /&gt;
                  &lt;data android:scheme="file" /&gt;
                  &lt;data android:mimeType="application/vnd.android.package-archive" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  </code></pre>