Android:市场更新后删除预装(预打包)应用程序快捷方式

发布于 2025-01-04 06:10:19 字数 645 浏览 1 评论 0原文

我们开发了一款预装在 Android 设备上的占位符应用程序。它所做的只是指向市场 URL,以便可以使用实际应用程序进行更新。实际上,“占位符”只不过是应用程序的早期版本,其中包含针对市场启动意图的活动。在市场中,我们部署了具有更高版本号的应用程序,以便市场能够显示“更新”按钮。

所有这些都运行良好,但需要注意的是:设备将在“主”屏幕中附带应用程序的快捷方式。更新完成后(通过占位符或手动浏览市场),快捷方式将从屏幕上删除。我们需要找到一种方法来保持快捷方式完好无损。

在我们的测试过程中,我们意识到如果我们通过市场更新侧面加载的应用程序,快捷方式就会被删除。如果更新的应用程序最初是由 Market 应用程序安装的,则一切正常(即快捷方式保留在原处)。

但是,我们有一个使用 Adob​​e Air 创建的应用程序,该应用程序由第三方公司为我们开发,安装得很好并保留了快捷方式。换句话说,如果我们侧载并启动它,则在通过市场完成更新后,快捷方式仍保留在“主”屏幕中。

我们一开始认为这可能是 Adob​​e Air 运行时监听 android.intent.action.PACKAGE_ADDED 并自动创建快捷方式。但是,卸载 Adob​​e Air 并没有改变这种行为。

Android 清单文件中是否有任何配置可用于此目的?或者可能是第三方应用程序在进入市场之前为自己创建了一条捷径?

We developed a placeholder application to ship pre-installed on Android devices. All it does is to point to a market URL so that it can be updated with the real application. In effect, the "placeholder" is nothing more than an earlier version of the app with an activity that launches an intent for the market. In the market we deployed the application with a higher version number so the market is able to display the "Update" button.

All works well with a caveat: the devices will ship with a shortcut to the app in the "home" screen. Once the update is done (either through the placeholder or going manually through the market) the shortcut is removed from the screen. We need to find a way to leave the shortcut intact.

During our tests, we realized that the shortcuts are removed if we update a side-loaded application through the market. All works well (i.e. the shortcut is left in place) if the updated app was originally installed by the Market app.

However, we have an application created with Adobe Air, developed by a third party company for us, which installs just fine and leaves the shortcut in place. In other words, if we side-load and launch it, after the update is done through the market the shortcut remains in the "home" screen.

We thought at first that it could be the Adobe Air runtime listening to android.intent.action.PACKAGE_ADDED and creating the shortcut automatically. However, uninstalling Adobe Air did not change this behavior.

Is there any configuration in the Android manifest file that could be used for this purpose? Or might it be that the third party application creates a shortcut to itself before going to the market?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

早乙女 2025-01-11 06:10:19

好的。回答我自己的问题以帮助其他人解决同样的问题。现在已经很明显了。

确保侧面加载的应用程序和发布到 Google Play 的应用程序中的 MAIN、LAUNCHER 活动相同。

在我们的存根中,入口点 Activity 被命名为 MainActivityStub,而在发布到 Google Play 的应用程序中,入口点 Activity 被命名为 MainActivity。更新完成后,MainActivityStub 不再可用,因此该链接已从主屏幕中删除。

Ok. Answering my own question to help others with the same issue. It is so obvious now.

Make sure your MAIN, LAUNCHER activity is the same in both the side loaded app and the app published to Google Play.

In our stub, the entry point Activity was named MainActivityStub, while in the app published to Google Play was named MainActivity. Once the update was complete, MainActivityStub was no longer available, thus the link got removed from the home screen.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文