where is com.google.android.gcm.GCMBaseIntentService?

Viewed 18593

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?

2 Answers

Download gcm.jar from here and place it in YOUR_PROJECT/app/libs directory and then add compile files('libs/gcm.jar') line in build.gradle file

Related