如何自动安装APK [英] how to automatically install an apk

查看:143
本文介绍了如何自动安装APK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法来自动触发刚刚下载的APK安装过程?

目前我下载包后,什么都不会发生,除非我单击该程序包,在这种情况下packege安装程序启动!

从哪里下载包在web.xml文件中的以下Tomcat服务器:

 <哑剧映射>
        <扩展名为GT;&APK LT; /展期>
        < MIME类型>应用/ vnd.android.package归档< / MIME类型>
    < / MIME映射>


解决方案

操作系统级别的权限才能调用实际安装APK文件的软件包管理系统的API。这些都不是提供给开发者或第三方应用程序。

由于Android市场是操作系统的一部分,并具有操作系统级的权限,它可以提示是否允许用户下载和下载开始前,一旦安装应用程序,并继续安装的其余部分,而无需用户输入。

第三方应用程序不能做到这一点。按照设计,只可用于开发/应用安装APK文件的方法是启动PackageInstaller活动,这将永远需要用户额外的验证步骤之前安装情况。

Is there a way to automatically trigger the installation process of a just downloaded apk ?

Currently after I download the package , nothing happens unless I click the package ,in which case the packege installer is launched !

The tomcat server from where I download the package has in the web.xml file the following :

    <mime-mapping>
        <extension>apk</extension>
        <mime-type>application/vnd.android.package-archive</mime-type>
    </mime-mapping>

解决方案

OS-level permissions are required to call the PackageManager APIs that actually install APK files. These are not available to developers or 3rd party apps.

Since the Android Marketplace is part of the OS and has OS-level permissions, it can prompt the user for permission to download and install an app once before the download begins, and continue the rest of installation without user input.

3rd party apps cannot do this. By design, the only method available for developers/apps to install APK files is to launch the PackageInstaller activity, which will always require an extra verification step from the user before the install happens.

这篇关于如何自动安装APK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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