Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automatically start the android apk install process when user clicks a download link on an website

According to developer.android.com

http://developer.android.com/tools/publishing/publishing_overview.html#publishing-website

When users browse to the download link from their Android-powered 
devices, the file is downloaded and Android system automatically 
starts installing it on the device. However, the installation process 
will start automatically only if the user has configured their 
Settings to allow the installation of apps from unknown sources.

it seems to be possible to automatically start the install process without the user interaction. I've checked the box to allow apps from unknown sources, but I still have to manually trigger the install process. I saw many posts on the same topic which seems to suggest the opposite of what is said on the official website:

How to install APK automatically when the file download is complete (hosted on private)

how to automatically install an apk

How to automatically launch the Android installer after downloading the apk?

others seems to suggest that the only way to have the install process automatically happen is through an already installed app:

Android: install .apk programmatically

The requirement that I have is that the user only need to click on one single link on a private deployment website, and the application installation would be triggered automatically without the user having to do anything else.

Currently when I click on the link in my deployment website, all it does it downloads the apk file, I need to manually start the install process.

None of those answers really gets me what I need, the instructions on the official website would be perfect since it doesn't require anything else, except I couldn't get it to work, installing another custom app to install the original app would also have the same problem when trying to install it.

We are also deploying iOS apps for testing purposes internally, the way we are doing that is through the manifest file link

http://help.apple.com/iosdeployment-apps/mac/1.1/#app43ad871e

sample link from the page: <a href="itms-services://?action=download-manifest&url=http://example.com/
manifest.plist">Install App</a>

Are there some extra steps that I have to do to get the instructions on the official android website to work? Maybe there is a way to get the download link to behave like an iOS manifest file link? Or perhaps there are some other ways to achieve my requirements?

Thanks.

like image 393
George Avatar asked Jun 11 '13 22:06

George


1 Answers

The requirement that I have is that the user only need to click on one single link on a private deployment website, and the application installation would be triggered automatically without the user having to do anything else.

That is up to the implementation of the Web browser, not you. The Web browsers that I use download the APK via DownloadManager, then show a Notification when the download is complete, where tapping on that Notification drawer entry starts the install process. While there is nothing stopping a browser from automatically invoking the ACTION_VIEW or ACTION_PACKAGE_INSTALL Intent that starts the installation process, that is up to the authors of the browser.

Are there some extra steps that I have to do to get the instructions on the official android website to work?

Find some browser that works the way you want.

like image 181
CommonsWare Avatar answered Sep 28 '22 07:09

CommonsWare