gpt4 book ai didi

java - 将 APK 与应用程序 bundle 在一起

转载 作者:行者123 更新时间:2023-12-01 07:02:02 24 4
gpt4 key购买 nike

我正在创建一个使用 ZLib(二维码阅读器)的应用程序,但它需要安装另一个应用程序才能工作。我希望能够将其他应用程序 APK 文件打包到我的 APK 中。这可能吗?

旁注:我尝试这样做是因为我的应用程序将在 Amazon Fire kindle 上使用,但必备应用程序仅在 Google Play 商店中。

最佳答案

您可以在您的应用中拥有其他应用 APK 的副本(例如在 Assets 目录中)。

安装应用程序后,您可以 copy the APK to the public storage并启动包管理器以从 APK 安装其他应用程序:

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

但请注意,这要求用户启用来自第三方来源的应用程序的侧面加载。

关于java - 将 APK 与应用程序 bundle 在一起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42597429/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com