Android Open Source - notify-me-android Notify Me App






From Project

Back to project page notify-me-android.

License

The source code is released under:

MIT License

If you think the Android project notify-me-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.contexthub.notifyme;
// ww w  .  j  ava 2s.c o m
import android.app.Application;
import android.content.Context;
import android.os.Build;
import android.text.TextUtils;
import android.util.Log;

import com.chaione.contexthub.sdk.ContextHub;
import com.chaione.contexthub.sdk.SensorPipelineEvent;
import com.chaione.contexthub.sdk.SensorPipelineListener;
import com.chaione.contexthub.sdk.push.Push;
import com.contexthub.notifyme.push.NotificationHandler;
import com.pixplicity.easyprefs.library.Prefs;

import java.util.Arrays;
import java.util.List;

/**
 * Created by andy on 10/27/14.
 */
public class NotifyMeApp extends Application implements SensorPipelineListener {

    private static Context instance;

    public NotifyMeApp() {
        instance = this;
    }

    public static Context getInstance() {
        return instance;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        ContextHub.init(this, "YOUR-APP-ID-HERE");
        ContextHub.getInstance().addSensorPipelineListener(this);

        List<String> tags = Arrays.asList(getString(R.string.device_tag_1), getString(R.string.device_tag_2));
        Push.init(instance, "YOUR-GCM-PROJECT-ID-HERE", Build.MODEL, tags, MainActivity.class, new NotificationHandler());

        Prefs.initPrefs(this);
    }

    @Override
    public void onEventReceived(SensorPipelineEvent event) {
        Log.d(getClass().getName(), event.getEventDetails().toString());
    }

    @Override
    public boolean shouldPostEvent(SensorPipelineEvent sensorPipelineEvent) {
        return true;
    }

    @Override
    public void onBeforeEventPosted(SensorPipelineEvent sensorPipelineEvent) {

    }

    @Override
    public void onEventPosted(SensorPipelineEvent sensorPipelineEvent) {

    }
}




Java Source Code List

com.contexthub.notifyme.ApplicationTest.java
com.contexthub.notifyme.Constants.java
com.contexthub.notifyme.MainActivity.java
com.contexthub.notifyme.NotifyMeApp.java
com.contexthub.notifyme.fragments.AboutFragment.java
com.contexthub.notifyme.fragments.DeviceFragment.java
com.contexthub.notifyme.fragments.PushReceiveFragment.java
com.contexthub.notifyme.fragments.PushSendFragment.java
com.contexthub.notifyme.model.CustomData.java
com.contexthub.notifyme.model.PushNotificationHistory.java
com.contexthub.notifyme.model.ReceivedPushNotification.java
com.contexthub.notifyme.push.NotificationHandler.java
com.contexthub.notifyme.widget.ClipboardTextView.java