Android 应用程序版本更新服务,无需将其发布到市场 [英] Android App Version Update service without releasing it to marketplace

查看:37
本文介绍了Android 应用程序版本更新服务,无需将其发布到市场的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我要从事一个项目,其中的要求有点奇怪.我被要求开发一个应用程序,该应用程序不会上传到任何市场,如 Playstore 或任何其他 Android 应用程序商店.它将简单地上传到云端以在用户之间分发 APK.

Recently I am going to work on a project in which the requirement is little weird. I am asked to develop a app which will not be uploaded to any marketplace like playstore or any other android app stores. It will be simply uploaded in cloud to distribute the APK among users.

应用在用户设备上安装后,当有新版本发布时,会通知用户(通知不是下载新版本并重新安装,而是授予权限和更新).用户授予权限后,应用程序将更新.在没有市场帮助的情况下做到这一点的最佳方法是什么?

After the app is being installed on user device, when a new version will be released, the user will be notified (notified not to download the new version and re-install, but to grant permission and update). After the user grant permission, the app will be updated. What's the best way to do this without the marketplace help?

我的想法:

  1. 使用 GCM(Google Cloud Messaging)通知用户并提供新版本链接.
  2. 用户将点击链接,将下载一个新版本并替换之前的版本(android 默认版本替换)

有没有更聪明的方法来实现我真正想要实现的目标?

Is there any smarter way to do what I want to achieve actually?

推荐答案

我发现最好的方法是托管 apk 和带有最新版本 # 的文本文件.

The best way to do this I have found, was to host the apk and a text file with the latest version #.

打开应用程序后,将当前的 v # 与服务器上托管的 v # 核对,如果它们不匹配,请获取新的 v#.

Opon opening the app, check the current v # against the one hosted on the server, if they dont match, grab the new one.

除非您的应用作为后台服务运行,否则无需推送任何内容,并且您需要确保用户是否使用最新版本,无论他们是否使用它.

No need for pushing anything unless your app works as a background service and you need to ensure that whether the user is on the latest version whether they use it or not.

如果是这种情况,您可以使用每天执行一次或类似的服务.

If that is the case, you can have a service that does it once a day or something like that.

编辑 - 下载后,要安装 apk,请使用以下代码.

EDIT - after downloaded, to install the apk, use the following code.

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

在 Android 上以编程方式安装应用程序

这篇关于Android 应用程序版本更新服务,无需将其发布到市场的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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