Android Open Source - mmx-starter-android My Wakeup Listener






From Project

Back to project page mmx-starter-android.

License

The source code is released under:

Apache License

If you think the Android project mmx-starter-android 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.magnet.demo.mmx.starter;
/* w  w  w .ja v a2s . c  o m*/
import android.content.Context;
import android.content.Intent;

import com.magnet.mmx.MMXClient;
import com.magnet.mmx.MMXClient.MMXWakeupListener;

/**
 * This listener is registered during Application.onCreate() to handle GCM and AlarmManager wakeups.
 * See MyApplication.onCreate().
 */
public class MyWakeupListener implements MMXWakeupListener {
  private static final String TAG = MyWakeupListener.class.getSimpleName();

  public void onWakeupReceived(final Context applicationContext, Intent intent) {
    MyMMXListener myListener = MyMMXListener.getInstance(applicationContext);
    MMXClient client = MMXClient.getInstance(applicationContext, R.raw.quickstart);
    client.connect(myListener);
  }
}




Java Source Code List

com.magnet.demo.mmx.starter.ApplicationTest.java
com.magnet.demo.mmx.starter.MainActivity.java
com.magnet.demo.mmx.starter.MyApplication.java
com.magnet.demo.mmx.starter.MyMMXListener.java
com.magnet.demo.mmx.starter.MyWakeupListener.java