Android应用需要Google Play服务更新-“打开"按钮而非“更新" [英] Android app requires Google Play Service Update - Open button instead of Update

查看:346
本文介绍了Android应用需要Google Play服务更新-“打开"按钮而非“更新"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了使用GCM(Google云消息传递),我需要在我的应用程序中实现Google Play服务库.一切都可以在我的Galaxy S2(Android 4.1.2)上运行,但是在我的HTC(Android 2.2.2)上,我无法更新Google Play服务.

In order to use GCM (Google Cloud Messaging) I need to implement Google Play Service library in my application. Everything works on my Galaxy S2 (Android 4.1.2) but on my HTC (Android 2.2.2) I can't update Google Play Service.

在创建应用程序(onCreate)时,我检查是否已安装Google Play服务或是否需要对其进行更新:

When application is creating (onCreate), I check if Google Play Service is installed or its need to be updated:

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服务.但是当他到达时,没有更新"按钮!只有2个按钮:打开"和卸载"!

User is redirected to Market to update Google Play Service. But when he arrives, there is no "Update" button! It's only 2 buttons: "Open" and "Uninstall" !

我该怎么办?

更新

我刚刚发现Google放弃了对Android< = 8(2.2.2)的支持.

I just found out that Google drops support for Android <= 8 (2.2.2).

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

With over 97% of devices now running Android 2.3 (Gingerbread) or newer platform versions, we’re dropping support for Froyo from this release of the Google Play services SDK in order to make it possible to offer more powerful APIs in the future. That means you will not be able to utilize these new APIs on devices running Android 2.2 (Froyo).

推荐答案

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

There is no current version of Google Play Services for your device. If there is no update available the PlayStore will just offer you to open the application.

这篇关于Android应用需要Google Play服务更新-“打开"按钮而非“更新"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆