我正在开发一个非公开的 Android 应用程序,即该应用程序不会在全球 Android 市场上提供.该应用程序将安装在有限数量的客户端上,例如通过使用 apk 文件.如何在此应用中启用自动更新功能?
I'm developing a non-public Android app, i.e. the app won't be available in the global Android Market. The app will be installed on a limited number of clients, e.g. by using an apk file. How can I enable an auto-update functionality in this app?
我看到了不同的潜在选择(我不知道这些在技术上是否难以实现,甚至无法实现,或者是否有任何可以重复使用的现有功能):
I see different potential options (I do not know if those are technically hard or even impossible to implement or if there are any existing functionalities that can be reused):
我更喜欢选项一,因为自动更新功能包含在需要较少开发工作的应用程序中.
I would prefer option one since the auto-update functionality is included in the app which needs less development efforts.
janjonas,在我工作的公司中,我们在使用 Windows Mobile 6.x 时遇到了类似的问题,我们使用的解决方案几乎与 EboMike 指出的相同:
janjonas, in the company I work we had a similar problem with Windows Mobile 6.x, and we use pretty much the same solution pointed by EboMike:
主应用程序根据 WebService 检查它是否已更新.它接收当前版本 &下载新版本的 URL(如有必要).然后主应用程序启动 Updater 应用程序,传递 URL,然后退出.
The main app check if it's updated, against a WebService. It receives the current version & the URL from where download the new version, if necessary. The main app then start the Updater app, passing the URL, and quit.
更新程序通过 HTTP 下载新程序,向用户显示下载的百分比.用户可以随时以受控方式取消下载,更新程序可以注册此取消.
The Updater do the download of the new program, via HTTP, showing to the user the % downloaded. The user can cancel the download anytime, in a controlled way, and the Updater can registry this cancellation.
由于下载了新应用,更新程序运行新应用并退出.
Since the new app is downloaded, the Updater run the new app, and quit.
这篇关于(私有)Android 应用程序的自动更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!