(私有)Android 应用程序的自动更新 [英] Auto-Update for (private) Android apps

查看:21
本文介绍了(私有)Android 应用程序的自动更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个非公开的 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):

  • 在每次启动时,应用都会测试是否存在新版本(通过请求服务器),如果存在,则下载新的 apk 并将其自身替换为新版本.
  • 使用(或开发?)一个独立的应用或服务来承担更新检查和替换过程.
  • 使用(或开发?)具有自动更新选项的私人市场应用.此选项类似于第二个选项,但更通用:市场应用程序将连接到存储库,即它将处理任意数量的(私有)应用程序.

我更喜欢选项一,因为自动更新功能包含在需要较少开发工作的应用程序中.

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 应用程序的自动更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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