java Android 从自己的服务器自动更新
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17274076/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android autoupdate from own server
提问by meklod400
Ive been looking for a good example, how to update my own developed application. So, I have an installed apk on my device and when I started it I'd like to check if any updates are exist on my server. If it does, then download from the webserver and install it.
我一直在寻找一个很好的例子,如何更新我自己开发的应用程序。所以,我在我的设备上安装了一个 apk,当我启动它时,我想检查我的服务器上是否存在任何更新。如果是,则从网络服务器下载并安装它。
At first I have to check to my server if there are any updates. If it does then download and install it.
首先,我必须检查我的服务器是否有任何更新。如果是,则下载并安装它。
Which is the best way for that? And anybody could show me some tutorial or maybe example?
哪个是最好的方法?任何人都可以向我展示一些教程或示例?
Thanks afurther to your answers
进一步感谢您的回答
回答by Matthias
Check out this link. It uses a HTTP connection in an async task to download the APK file from an URL. When the download is finished it starts a new intend for showing/installing the APK (see this article).
查看此链接。它在异步任务中使用 HTTP 连接从 URL 下载 APK 文件。下载完成后,它会开始显示/安装 APK 的新计划(请参阅本文)。