I'm Android Developer since a year ago, but I've never done any app which communicates between devices (just GET and POST calls).
I'm thinking about making a card game in Android Native (not Cocos2D-x or a game engine).
The way to communicate between devices is GCM, but I didn't fully understand how I can handle the game logic.
I know that the class GCMIntentService
can Override:
@Override
protected void onRegistered(Context context, String registrationId) {
Log.i(TAG, "onRegistered: registrationId=" + registrationId);
}
@Override
protected void onUnregistered(Context context, String registrationId) {
Log.i(TAG, "onUnregistered: registrationId=" + registrationId);
}
@Override
protected void onMessage(Context context, Intent data) {
}
@Override
protected void onError(Context arg0, String errorId) {
Log.e(TAG, "onError: errorId=" + errorId);
}
My question is: do I have to develop all the game logic on onMessage()
? could you provide me an example?
Thanks in advance.