Android-比较我的应用程序和google play market之间的应用程序版本号

Android-比较我的应用程序和google play market之间的应用程序版本号,android,Android,我目前使用Android版本名作为版本号,并使用以下方法获取应用程序版本号 <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.myApp" android:versionCode="12" android:versionName="1.2.37"> 但是我上传到google play的版本是1.2.39 如何获取google play应用程序

我目前使用Android版本名作为版本号,并使用以下方法获取应用程序版本号

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.android.myApp"
  android:versionCode="12"
  android:versionName="1.2.37">
但是我上传到google play的版本是1.2.39


如何获取google play应用程序版本1.2.39,然后启动终端设备用户下载最新verion的apk?

google play服务不公开此类返回当前发布版本的API,尽管您可以创建自己的API以显示弹出窗口来更新应用程序。

好的。如果playstore上有更新版本最终用户将收到自动下载最新版本的通知(通过googleplay)。你不需要做任何事情,只要让Google Play帮你处理。不要不必要地过度复杂你的应用程序。
try {
    PackageManager manager = context.getPackageManager();
    PackageInfo info = manager.getPackageInfo("org.moo.android.myApp", 0);
    int code = info.versionCode;
    String name = info.versionName;

    // Compare with values on the server to see if there is a new version
} catch(NameNotFoundException nnf) {
    nnf.printStackTrace();
}