Android 应用程序需要 Google Play 服务更新 - 打开按钮而不是更新

2024-04-07

为了使用 GCM(Google Cloud Messaging),我需要在我的应用程序中实现 Google Play 服务库。在我的 Galaxy S2 (Android 4.1.2) 上一切正常,但在我的 HTC (Android 2.2.2) 上我无法更新 Google Play 服务。

当应用程序创建(onCreate)时,我检查是否安装了 Google Play 服务或者是否需要更新:

public static boolean isGooglePlayServiceEnabled(Context context)
{
    return GooglePlayServicesUtil.isGooglePlayServicesAvailable(context) == ConnectionResult.SUCCESS ? true : false;
}

在我的活动中:

onCreate(Bundle savedInstance)
{
    // Some code....
    if (!isGooglePlayInstalled(this))
    {
        int errorCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(instance)
        if (errorCode == ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED)
        {
            // Alert Dialog and prompt user to update App
            startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.google.android.gms")));
        }
    }
}

用户被重定向到市场以更新 Google Play 服务。但当他到达时,却没有“更新”按钮!只有两个按钮:“打开”和“卸载”!

我应该怎么办?

UPDATE

我刚刚发现 Google 放弃了对 Android

目前超过 97% 的设备运行 Android 2.3 (Gingerbread) 或 较新的平台版本,我们从此放弃对 Froyo 的支持 发布 Google Play 服务 SDK,使其成为可能 以便将来提供更强大的 API。这意味着你不会 能够在运行 Android 2.2 (Froyo) 的设备上使用这些新 API。


您的设备没有当前版本的 Google Play 服务。如果没有可用的更新,PlayStore 只会向您提供open应用程序。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Android 应用程序需要 Google Play 服务更新 - 打开按钮而不是更新 的相关文章

随机推荐