8

I just saw that google deprecated the C2DM and replace it by GCM. On their website they describe us, step by step, the way to follow to install the GCM library required to start implementing the new android push notification (or Cloud Messaging, as they name it).

On the "Install the Helper Libraries" is written:

To perform the steps described in the following sections, you must first install the helper libraries (reference: client and server). 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-demo-appengine, gcm-demo-client, gcm-demo-server, and gcm-server.

I opened the SDK manager from Eclipse, but under the Extras is nothing except "Intel hardware accelerated execution manager". I don't see something else.

How do I find/add/install the GCM in SDK manager?

onkar
  • 4,427
  • 10
  • 52
  • 89
Zelter Ady
  • 6,266
  • 12
  • 48
  • 75

8 Answers8

23

The Best and easiest way I got after trying a lot of time

Go to this link

https://dl-ssl.google.com/android/repository/addon.xml

at the end of this page you will find a section Google cloud messaging for android with following line

<sdk:url>gcm_r03.zip</sdk:url>

just replace addon.xml by gcm_r03.zip in url mentioned above, The final url will look like this

https://dl-ssl.google.com/android/repository/gcm_r03.zip

when download completes extract the zip file, you will get three directories with names client side, server side and samples.

now open your SDK folder and create a folder named "extras/android" and paste all three folders here DONE!!

now whenever make a new project in project classpath using add external jar add gcm.jar.

I have explained the whole process because same can be used to download other SDK stuff like platform-tools and platforms as zip so you can configure eclipse without an internet connection anywhere.

Piyush Agarwal
  • 25,608
  • 8
  • 98
  • 111
  • It's working for me. I tried so many samples in extras/google. But now tried in 'extras/android' appear this Google cloud services for Android appear in the sdk manager... – gnganapath Mar 16 '15 at 09:32
  • hi I follow all step as you said ,but notifications not received on phone and got “internal error: retry receiver class not set yet” error on my log. Please help me to solve this – SAndroidD Jun 09 '15 at 08:35
8

Just open your SDK and Click to Obsolate below and you will find the Google Cloud Messaging for Android Library

Rishabh Agrawal
  • 1,998
  • 2
  • 25
  • 40
6

Above not work for me.I tried this way...Go to sdk manager, check obsolete... gcm library will come. it works for me..

Arunkumar
  • 111
  • 1
  • 13
4

You have to upgrade your SDK Tools to rev 20 and Platform-tools to rev 12 before the 'Google Cloud Messaging for Android Library' will appear in the 'Extras' folder.

Also, if you already have a working C2DM project, you just need to change the SENDER_ID, without including the GCM library

onkar
  • 4,427
  • 10
  • 52
  • 89
azgolfer
  • 15,087
  • 4
  • 49
  • 46
2

None of the previous suggestion worked for me. But...

I found something strange: if I start the SDK manager from Eclipse (Windown -> Android SDK manager) I don't see all the updates. If I go to the filesystem, in windows explorer, and I start the SDK manager from there I have a bigger list of available packages.

Strange but worked for me!

Zelter Ady
  • 6,266
  • 12
  • 48
  • 75
  • The Reason to not displaying in the updated in SDK manager from Eclipse, is because that updates are not supported with your current Eclipse. To download these updates you need to upgrade your eclipse. – V.J. May 11 '15 at 13:51
1

Yes Zelter Ady is right. I also faced the same secanrio but when I accessed SDK manager from Windows Explorer (on my windows machine) C:\Program Files\Android\android-sdk, I am able to get a bigger list of updates under which SDK 4.1 (API 16) is also there apart from Extras->Google cloud Messaging for Android. I was unable to update SDK with API 16 from Eclipse plugin of SDK Manager.

Khushboo
  • 3,095
  • 2
  • 23
  • 24
1

For Android Studio version 1.5:

Go to Tools -> Android -> SDK -> click Launch standalone below in sdk manager, it will open new window -> Check Obsolete below -> install Google Cloud Messaging for Android Library

Stephen
  • 9,899
  • 16
  • 90
  • 137
0

Update your SDK manager in Eclipse: Help -> Check for updates. Install updates.

Klaasvaak
  • 5,634
  • 15
  • 45
  • 68