I tried to integrate new GCM Google Cloud Messaging. I put the below
function, but it gives the error mentioned below. Any help would be
appreciated.
I put the gcm.jar for client into my libs folder and provided reference to
it to use it in my android application.
private void registerForGCM(){
try {
GCMRegistrar.checkDevice(Login.this);
GCMRegistrar.checkManifest(Login.this);
final String regId = GCMRegistrar.getRegistrationId(Login.this);
if (regId.equals("")) {
GCMRegistrar.register(this, SENDER_ID);
} else {
Log.v("GCM (Google Cloud Messaging)", "Already registered");
}
} catch (Exception e) {
e.printStackTrace();
}
}
Error:
java.lang.NoClassDefFoundError: com/google/android/gcm/GCMRegistrar
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en