I am begginer in Android App and using Java as when I add this code :
GCMRegistrar.checkDevice(this);
GCMRegistrar.checkManifest(this);
final String regId = GCMRegistrar.getRegistrationId(this);
if (regId.equals("")) {
GCMRegistrar.register(this, SENDER_ID);
} else {
Log.v(TAG, "Already registered");
}
I had error on :
SENDER_ID
Log
TAG
the error “cannot be resolved to available “
As I commented if you’re a beginner you shouldn’t start with GCM, but seems that you’re a beginner not only on Android but also in Java (this is not bad, everybody was a beginner, and I’m not that advanced).
I suggest you to start following some basic tutorials on Java, then start with some basic tutorial for Android and so on.
GCM requires also a server side, so this is going to be quite advanced.
Anyway, the error is simple. SENDER_ID is a field that you haven’t defined anywhere.
You have to declare it somewhere, like:
or at the top of your class: