Html页面下载和浏览器安装APK浏览器、页面、Html、APK

2023-09-05 03:24:51 作者:欧

我有一个应用程序,将通过公开的Web服务器的用户安装(外安卓市场)。

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

所以,我主持的Web服务器的apk文件,并指示用户键入的URL下载该文件,然后打开下载的文件进行安装。

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.

不过,用户几乎100%有困难做那些简单的任务(他们不熟悉的技术...)。

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的APK; 在下载完成后,启动Android的安装对话框安装下载的APK;

你下载的文件是pretty的方便,但现在我的问题是,打开浏览器,从安装对话框!

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

我完全新手的HTML / JavaScript的,我不知道如何做到这一点(或者即使这是可能的)。

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

推荐答案

通常情况下,你只链接到 .apk文件文件。当用户点击这样的链接, .apk文件文件下载并安装自动启动(用类似这样的对话你想安装此应用程序)。

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').

所以,只要< A HREF =yourdomain.com/yourapp.apk>下载并安装...< / A>

重要!这只能如果您的用户允许从设置/安全未知来源的安装。

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