默认
发表评论 18
想开发IM:买成品怕坑?租第3方怕贵?找开源自已撸?尽量别走弯路了... 找站长给点建议
我是某公司的Android程序开发。

一般情况下讨论用不用GCM,首先需要明确GCM的适用范围,然后我就去查GCM的详细信息,链接如下:Google Cloud Messaging for Android

看到了下面这么一段:

- Here are the requirements for running a GCM Android client:At a bare minimum, GCM requires devices running Android 2.2 or higher that also have the Google Play Store application installed, or an emulator running Android 2.2 with Google APIs. Note that you are not limited to deploying your Android applications through Google Play Store.

- However, if you want to continue to use new GCM features that are distributed through Google Play Services, the device must be running Android 2.3 or higher, or you can use an emulator running Android 2.3 with Google APIs.

- On Android devices, GCM uses an existing connection for Google services. For pre-3.0 devices, this requires users to set up their Google accounts on their mobile devices. A Google account is not a requirement on devices running Android 4.0.4 or higher.


翻译:

以下是Android客户端能运行GCM的条件:
1.  最低配置,Android系统2.2及以上并且同时安装有Google Play应用商店,或者是使用了GoogleAPIs,系统在2.2及以上的Android模拟器。请注意你不会被限制需要适用Google Play应用商店来下载App;

2.  然而,如果你想继续通过Google Play Services使用后续的GCM的新特性,设备系统必须等于或高于Android2.3(偷懒,模拟器相关支持就不翻译了);
  
3.  在Android设备上,GCM使用Google Services上存在的一个连接。对于3.0之前的设备,需要用户在移动设备上设置好谷歌账号。在Android4.0.4及以上版本则不需要谷歌账号。



我不要新服务我对账号没要求我只要最低配置,即使只看完第一条我也就Oh shit了,2.2系统完全没问题,问题是国内的手机能有几台安装了Google Play呢(包括后期自己装的)?!这时不是很Geek又懒(买国行Android还不刷机)的我还抱着点希望,打开我买的某国外品牌Android机的国行版本,下载了一个Google Services(Google Play依赖Google Services,没Services时Google Play无法正常使用),然后这个Services就不停地循环报崩溃...崩溃...崩溃...崩溃...然后我就崩溃了(卸掉)!


---------------补充分割---------------
有人提议双推送机制,有GCM用GCM,没有的时候再用Service。
答:对于绝大多数Android程序员来说(包括我),这是很无聊的一件事,需求有不少,还有好多BUG等着解,除非特别有必要,否则才懒得搞两套机制。

打赏楼主 ×
使用微信打赏! 使用支付宝打赏!

返回顶部