0

I have upload apk with version 1.0.0.0. I want to upload next version 1.0.0.1.how can I set the notification to inform the user that my application has a newer version available on Google play. Can any one suggest me how to do it?

rbashish
  • 2,073
  • 2
  • 24
  • 35
user2914699
  • 265
  • 1
  • 3
  • 7

3 Answers3

1

Found in stackoverflow (duplicated??)

public int getVersion() {
    int v = 0;
    try {
        v = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
    } catch (NameNotFoundException e) {
        // Huh? Really?
    }
    return v;
}
Community
  • 1
  • 1
Andynedine
  • 441
  • 5
  • 20
0

I understand your question to be "How does one determine if the play store has a newer version than the one installed".

I don't know of an official way to lookup an app's version in the Play Store. The most common solution I've seen for this requirement is to host the version number on a server somewhere and do a web request to get it.

There's a library at https://code.google.com/p/android-market-api/ that purports to do the Play Store lookup, (among other things) but I don't have any experience with it.

scottt
  • 8,301
  • 1
  • 31
  • 41
0

For that you have to configure something called Firebase Cloud Messaging and enable notification. Here is the complete guide on how to.

rbashish
  • 2,073
  • 2
  • 24
  • 35