ZeeZipper
ZeeZipper

Reputation: 83

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

My android app is published in google play store. I want to do,

  1. User get notified when there is new version of app.
  2. User must get notified when they are using an older version of app.

The problem I face is,

  1. If the user turns off automatic check for update option in google play store, they no longer get notified by the default option.
  2. If my user using the older version of my app, it will create problem for me in data management.(conflict problem etc.,)

So what i want is, the user opens my app, checks for the current version code of the app and compare with version code of the app that is in google play store.

I find it difficult to get the version code of the app that is in play store.

I tried following links to get the version code of the app on google play store but of not help.

SO question

https://code.google.com/p/android-market-api/

[How to allow users to check for the latest app version from inside the app?

please help..

How can i programmatically get the version code of the app that is on play store.

Or is there any way that by which I can manually trigger the default built-in event as handled by google play services?

Upvotes: 0

Views: 7110

Answers (3)

Nicholas Barrow
Nicholas Barrow

Reputation: 736

We made a CLI to make this much simpler: https://github.com/inspire-labs-tms-tech/google-play-app-version-code-cli

The README provides much better setup docs, etc., but getting the next available versionCode is basically as simple as running:

JSON=$(cat ~/path/to/key.json) && google-app-version next -f "$JSON" --package com.company.app
# 15

Or, for the current/latest release versionCode:

JSON=$(cat ~/key.json) && google-app-version latest -f "$JSON" -p com.company.app
# 14

Upvotes: 0

kansaz
kansaz

Reputation: 31

Actually, solution that based on Google page html is not stable and need to be changed whenever Google update their layout. In addition, the version number from Google page is truly versionName but not versionCode. For example: Regard to build.gradle file, versionCode is 5 and versionName is 5.1. For this case, Google store page will show us Current version is 5.1 but not 5.

Upvotes: 0

Buda Gavril
Buda Gavril

Reputation: 21657

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

Upvotes: 1

Related Questions