Html page to download and install apk from browser

41,618

Solution 1

Normally, you just link to the .apk file. When the user clicks on such a link, the .apk file is downloaded and the installation is automatically started (with a dialog like 'do you want to install this application').

So, just <a href="yourdomain.com/yourapp.apk">Download and install...</a>.

Important! This only works if your users allow installation from 'Unknown sources' in settings/security.

Solution 2

If browser is written not by you, then it doesn't know what to do with downloaded apk file. Ask user to download something like EasyInstall to install side-loaded apks or place you apk on Google Play. Google Play app on the device knows how to install apk.

-- True at the time of writing: Aug. 2012

Solution 3

You need to ensure your webserver that is going to deliver the APK sets the MIME type properly. It should be application/vnd.android.package-archive for .apk files.

Share:
41,618
Christian
Author by

Christian

#SOreadytohelp

Updated on September 23, 2020

Comments

  • Christian
    Christian over 3 years

    I have an app that will be installed by the user from a public webserver (outside android market).

    So I hosted the apk in webserver and instructed the users to type the url to download the file and then "open" the downloaded file to install it.

    But, almost 100% of users are having difficulties to do those simple tasks (they're are not familiar with technology...).

    So, I decided to make a webpage that will simplify the task. The page contains a single big button that will:

    • Donwload the apk;
    • After download finish, start "Android's Install Dialog" to install the downloaded apk;

    Dowloading file is pretty easy, but now my problem is to open the "Install dialog" from browser!

    I'm totally newbie about html/javascript and I don't know how to do it (or even if this is possible).