Google云端通讯的Andr​​oid进口问题 [英] GoogleCloudMessaging Android Import Issue

查看:115
本文介绍了Google云端通讯的Andr​​oid进口问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图实现一个Android应用程序推送通知,我发现很多例子,但他们所有的进口 com.google.android.gcm - 一个包,此后一直与德pcated $ p $(据说)其功能折成 GooglePlayServices 包(我有版本15 )。我试过挂钩,作为好,而且不与例如code工作,似乎需要去precated包。

I am attempting to implement push notifications in an Android application, and I found plenty of examples, but they all import com.google.android.gcm - a package that has since been deprecated with (supposedly) its features folded into the GooglePlayServices package (I have version 15). I've tried to hook up that as well, and it does not work with the example code, and seems to require the deprecated package.

没有人有任何最新的例子吗?

Does anyone have any up to date examples?

任何帮助将大大搞清楚了这一点pciated AP $ P $!

Any help would be greatly appreciated in figuring this out!

推荐答案

我不知道为什么你正在寻找其他的例子,而谷歌已经提供完整的工作code例如包括服务器和客户端。你有什么需要的只是在这里源$ C ​​$ C一>。命名导入项目 GCM客户端到工作空间。添加的Google Play-services_lib 从Android SDK中文件夹作为库项目。更改SENDER_ID在位于 com.google.android.gcm.demo.app <​​/ code>包DemoActivity。而已。

I wonder why you are looking for other example while google have provided you complete working code example including both server and client. What do you need is just to check out source code from here. Import project named "gcm-client" into work space. Add "google-play-services_lib" project from android sdk folder as a library. Change your SENDER_ID in DemoActivity located in com.google.android.gcm.demo.app package. That's it.

忽略样本/ GCM-演示客户端下载相同code目录中。它采用老德precated类。你可以重复使用它的实用工具类 ServerUtilities 发送/删除注册ID /从你的服务器。 [感谢NickT确定]

Please ignore samples/gcm-demo-client in same downloaded code directory. It uses old deprecated classes. You may reuse its utility class ServerUtilities to send/delete registration id to/from your server. [Thanks NickT for identifying ]

编辑:

德precated code是依然存在的 GCM客户端的德precated 上给出的信息库。不理会它,并使用 GCM客户端

Deprecated code is still exist as gcm-client-deprecated on given repository. Just ignore it and use gcm-client.

这篇关于Google云端通讯的Andr​​oid进口问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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