Checking My App Version Programmatically in Android Market

Checking my app version programmatically in Android market

Google Play does not provide any official APIs for retrieving metadata. You could however, check the unofficial API at http://code.google.com/p/android-market-api/.

Specifically, take a look at the Wiki page HowToSearchApps. The response to the query contains version information:

{
"app": [
{
"rating": "4.642857142857143",
"title": "Ruboto IRB",
"ratingsCount": 14,
"creator": "Jan Berkel",
"appType": "APPLICATION",
"id": "9089465703133677000",
"packageName": "org.jruby.ruboto.irb",
"version": "0.1",
"versionCode": 1,
"creatorId": "\"Jan Berkel\"",
"ExtendedInfo": {
"category": "Tools",
"permissionId": [
...

Programmatically check Play Store for app updates

Update 17 October 2019

https://developer.android.com/guide/app-bundle/in-app-updates

Update 24 april 2019:

Android announced a feature which will probably fix this problem. Using the in-app Updates API:
https://android-developers.googleblog.com/2018/11/unfolding-right-now-at-androiddevsummit.html

Original:

As far a I know, there is no official Google API which supports this.

You should consider to get a version number from an API.

Instead of connecting to external APIs or webpages (like Google Play Store).
There is a risk that something may change in the API or the webpage, so you should consider to check if the version code of the current app is below the version number you get from your own API.

Just remember if you update your app, you need to change the version in your own API with the app version number.

I would recommend that you make a file in your own website or API, with the version number. (Eventually make a cronjob and make the version update automatic, and send a notification when something goes wrong)

You have to get this value from your Google Play Store page (is changed in the meantime, not working anymore):

<div class="content" itemprop="softwareVersion"> x.x.x  </div>

Check in your app if the version used on the mobile is below the version nummer showed on your own API.

Show indication that she/he needs to update with a notification, ideally.

Things you can do

Version number using your own API

Pros:

  • No need to load the whole code of the Google Play Store (saves on data/bandwidth)

Cons:

  • User can be offline, which makes checking useless since the API can't be accessed

Version number on webpage Google Play Store

Pros:

  • You don't need an API

Cons:

  • User can be offline, which makes checking useless since the API can't be accessed

    • Using this method may cost your users more bandwidth/mobile data
    • Play store webpage could change which makes your version 'ripper' not work anymore.

Android get Google Play Store app version

Just replace your code

.get()
.select("div[itemprop=softwareVersion]")
.first()
.ownText();


with below:

.get()
.select(".hAyfc .htlgb")
.get(3)
.ownText();

it will work..!

Programatically getting the version code of the app that is in play store

why don't you save your latest version in a google document on google drive and from your application read that value?

Here is the api



Related Topics



Leave a reply



Submit