Android的编程方式更新应用程序时,一个新的版本可用 [英] Android programmatically update application when a new version is available

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

问题描述

在我的应用程序,我想检查是否有我的应用程序的任何更新版本的应用程序商店。如果有任何,则必须通过一条警告消息来通知用户,如果他/她选择升级我想更新新version.I想要做的这一切,通过我的申请。这可能吗?

Within my application, I want to check if there is any updated version of my application is in the app store. If there is any, then have to inform the user through an alert message and if he/she opt for upgrade I want to update the new version.I want to do all this through my application. Is this possible?

推荐答案

我有同样的问题,但解决了JSOUP库。 这里是图书馆下载链接: http://jsoup.org/download

I have the same issue but it resolved by JSOUP library. Here is the library download link: http://jsoup.org/download

String newVersion = Jsoup
                        .connect(
                                "https://play.google.com/store/apps/details?id="
                                        + "Package Name" + "&hl=en")
                        .timeout(30000)
                        .userAgent(
                                "Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv1.8.1.6) Gecko/20070725 Firefox/2.0.0.6")
                        .referrer("http://www.google.com").get()
                        .select("div[itemprop=softwareVersion]").first()
                        .ownText();

                Log.e("new Version", newVersion);

这篇关于Android的编程方式更新应用程序时,一个新的版本可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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