为了使用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服务.但是当他到达时,没有“更新”按钮!它只有2个按钮:“打开”和“卸载”!
我该怎么办?
UPDATE
我刚刚发现谷歌放弃了对Android< = 8(2.2.2)的支持.
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将仅提供您打开该应用程序.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。