从浏览器下载和安装 apk 的 Html 页面 [英] Html page to download and install apk from browser

查看:53
本文介绍了从浏览器下载和安装 apk 的 Html 页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个由用户从公共网络服务器(Android 市场之外)安装的应用.

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

所以我将 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:

  • 下载apk;
  • 下载完成后,启动Android's Install Dialog"安装下载的apk;

下载文件很容易,但现在我的问题是从浏览器打开安装对话框"!

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.

这篇关于从浏览器下载和安装 apk 的 Html 页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆