简体   繁体   English

如何安装存储在另一个apk ..的资产文件夹中的apk文件?

[英]How to install the apk file stored in assets folder of another apk ..?

I am shipping a .apk file to the assets folder of another apk. 我正在将.apk文件运送到另一个apk的资产文件夹中。 Now, I want to install the apk stored in assets folder . 现在,我要安装存储在Assets文件夹中的apk。 Install apk from assets folder automatically / programmatically.... is this possible .......? 从资产文件夹自动/以编程方式安装apk。

You can do something like this. 你可以做这样的事情。

Intent promptInstall = new Intent(Intent.ACTION_VIEW)
    .setDataAndType(Uri.parse("file:///path/to/your.apk"), 
                    "application/vnd.android.package-archive");
startActivity(promptInstall); 

this is an old post but for others i want to share my experience with the same issue. 这是旧文章,但对于其他人,我想与我分享同一问题的经验。 The error "There was problem parsing the package" came because you have modify the apk name. 由于您已修改apk名称,因此出现错误“解析软件包时出现问题”。 you must let its original name. 您必须保留其原始名称。 hope this help. 希望有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM