com.google.android.gcm.GCMBaseIntentService在哪里? [英] where is com.google.android.gcm.GCMBaseIntentService?
问题描述
我在这里 http://developer.android.com/guide/上的关于GCM的教程google / gcm / gs.html
在第2步的第5点,它说:
添加以下intent服务:
service android:name =。GCMIntentService
这个意向服务将由GCMBroadcastReceiver(由GCM库提供)调用,如下一步所示。它必须是 com.google.android.gcm.GCMBaseIntentService
的子类,必须包含一个公共构造函数,并且应该命名为 my_app_package.GCMIntentService code>(除非您使用
GCMBroadcastReceiver
的子类覆盖用于命名服务的方法)。
<但是,我不能继承 com.google.android.gcm.GCMBaseIntentService
,导入无法解析。如何解决这个问题?
您必须安装库: http://developer.android.com/guide/google/gcm/gs.html#libs
在SDK Manager中,安装附加功能>适用于Android库的Google Cloud Messaging。这将在YOUR_SDK_ROOT / extras / google /目录下创建一个包含以下子目录的gcm目录:gcm-client,gcm-server,samples / gcm-demo-client,samples / gcm-demo-server和samples / gcm-demo-appengine。 / p>
I'm following the tutorial on GCM here http://developer.android.com/guide/google/gcm/gs.html
At point 5 of Step 2, it says:
Add the following intent service: service android:name=".GCMIntentService"
This intent service will be called by the GCMBroadcastReceiver (which is is provided by GCM library), as shown in the next step. It must be a subclass of com.google.android.gcm.GCMBaseIntentService
, must contain a public constructor, and should be named my_app_package.GCMIntentService
(unless you use a subclass of GCMBroadcastReceiver
that overrides the method used to name the service).
However, I can't subclass com.google.android.gcm.GCMBaseIntentService
, the import can't be resolved. How do I fix this?
You have to install the libraries: http://developer.android.com/guide/google/gcm/gs.html#libs
From the SDK Manager, install Extras > Google Cloud Messaging for Android Library. This creates a gcm directory under YOUR_SDK_ROOT/extras/google/ containing these subdirectories: gcm-client, gcm-server, samples/gcm-demo-client, samples/gcm-demo-server, and samples/gcm-demo-appengine.
这篇关于com.google.android.gcm.GCMBaseIntentService在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!