UpdateCheck

when you publish new version android app,maybe you want all your application user update new version.

this process follow 4-steps:

  1. check googleplay app version

  2. check device app version

  3. compare version

  4. alert new version update!

How to use

  • check googleplay app version
  String store_version = MarketVersionChecker.getMarketVersion(getPackageName());
  • check device app version
  String device_version = getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
  • compare version
 if (store_version.compareTo(device_version) > 0) {
	// need update

 } else {
	// no need update

 }

Reference