Android Open Source - Android-App Gcm Broadcast Receiver






From Project

Back to project page Android-App.

License

The source code is released under:

MIT License

If you think the Android project Android-App listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.cmbhack.crowdtrain;
//from  w  w  w .ja  v a2  s .c  om
import java.util.Date;

import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent; 
import android.util.Log;

public class GcmBroadcastReceiver extends android.support.v4.content.WakefulBroadcastReceiver {
  @Override
    public void onReceive(Context context, Intent intent) {
    Log.d("GCM","GCM recieved"); 
        ComponentName comp = new ComponentName(context.getPackageName(),
                GcmIntentService.class.getName()); 
        startWakefulService(context, (intent.setComponent(comp)));
        setResultCode(Activity.RESULT_OK);
    }
}




Java Source Code List

com.cmbhack.crowdtrain.GCMData.java
com.cmbhack.crowdtrain.GcmBroadcastReceiver.java
com.cmbhack.crowdtrain.GcmIntentService.java
com.cmbhack.crowdtrain.MainActivity.java