如果安装的google play services版本是4.1+,则在检查google play services可用性时需要获取connectionresult.success:

int code = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);

当前我正在获取代码==connectionresult.service_version_update_required,
当google play服务版本是5.0.84时。
我知道我所需要的是添加一些标签到manifest witch应该包括googleplayservices版本代码。但我不知道女巫一号和什么版本号属于4.1。
请指教。

最佳答案

这就是我现在发现的:
不需要对清单文件做任何更改。
google play服务的版本代码是7位数字,其复杂程度与版本名相同。
例如:
版本4.1.00的代码为4100000
版本6.5.99的代码为6599000
所以,当我需要检查安装的GooglePlayServices是否有足够的更新时,我会:

int code = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
    ...
    if (code == ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED) {
        if (GooglePlayServicesUtil.GOOGLE_PLAY_SERVICES_VERSION_CODE >= 4100000)
            result = true;// Meets minimum version requirements
    }

10-07 20:02
查看更多