Search in sources :

Example 26 with CustomEvent

use of com.crashlytics.android.answers.CustomEvent in project SightRemote by TebbeUbben.

the class AppLayerProcessor method onOutboundMessage.

@Override
public void onOutboundMessage(Object message, Pipeline pipeline) throws Exception {
    if (!(message instanceof AppLayerMessage))
        return;
    Log.d("SightService", "SEND: " + message.getClass());
    DataMessage dataMessage = new DataMessage();
    dataMessage.setData(((AppLayerMessage) message).serialize());
    pipeline.send(dataMessage);
    Answers.getInstance().logCustom(new CustomEvent("Sent Application Layer Message").putCustomAttribute("Message", message.getClass().getSimpleName()));
}
Also used : CustomEvent(com.crashlytics.android.answers.CustomEvent) AppLayerMessage(sugar.free.sightparser.applayer.messages.AppLayerMessage) DataMessage(sugar.free.sightparser.authlayer.DataMessage)

Example 27 with CustomEvent

use of com.crashlytics.android.answers.CustomEvent in project SightRemote by TebbeUbben.

the class AppLayerProcessor method onInboundMessage.

@Override
public void onInboundMessage(Object message, Pipeline pipeline) throws Exception {
    if (!(message instanceof DataMessage))
        return;
    DataMessage dataMessage = (DataMessage) message;
    ByteBuf byteBuf = new ByteBuf(dataMessage.getData().length);
    byteBuf.putBytes(dataMessage.getData());
    AppLayerMessage appLayerMessage = AppLayerMessage.deserialize(byteBuf);
    Log.d("SightService", "RECEIVE: " + appLayerMessage.getClass());
    pipeline.receive(appLayerMessage);
    Answers.getInstance().logCustom(new CustomEvent("Received Application Layer Message").putCustomAttribute("Message", appLayerMessage.getClass().getSimpleName()));
}
Also used : CustomEvent(com.crashlytics.android.answers.CustomEvent) AppLayerMessage(sugar.free.sightparser.applayer.messages.AppLayerMessage) DataMessage(sugar.free.sightparser.authlayer.DataMessage) ByteBuf(sugar.free.sightparser.pipeline.ByteBuf)

Example 28 with CustomEvent

use of com.crashlytics.android.answers.CustomEvent in project SightRemote by TebbeUbben.

the class TemporaryBasalRateActivity method onResult.

@Override
public void onResult(Object result) {
    if (result instanceof PumpStatusMessage) {
        PumpStatusMessage pumpStatusMessage = (PumpStatusMessage) result;
        if (pumpStatusMessage.getPumpStatus() != PumpStatus.STARTED) {
            showManualOverlay();
            hideLoadingIndicator();
            showSnackbar(Snackbar.make(getRootView(), R.string.pump_not_started, Snackbar.LENGTH_INDEFINITE));
        } else {
            hideLoadingIndicator();
            hideManualOverlay();
            dismissSnackbar();
        }
    } else {
        Answers.getInstance().logCustom(new CustomEvent("TBR Programmed"));
        finish();
    }
}
Also used : CustomEvent(com.crashlytics.android.answers.CustomEvent) PumpStatusMessage(sugar.free.sightparser.applayer.messages.status.PumpStatusMessage)

Aggregations

CustomEvent (com.crashlytics.android.answers.CustomEvent)28 Intent (android.content.Intent)6 Bundle (android.os.Bundle)3 HashMap (java.util.HashMap)3 Activity (android.app.Activity)2 ActivityNotFoundException (android.content.ActivityNotFoundException)2 Context (android.content.Context)2 Uri (android.net.Uri)2 AsyncTask (android.os.AsyncTask)2 AlertDialog (android.support.v7.app.AlertDialog)2 TextUtils (android.text.TextUtils)2 Toast (android.widget.Toast)2 Answers (com.crashlytics.android.answers.Answers)2 Sensor (com.eveningoutpost.dexdrip.Models.Sensor)2 StatsResult (com.eveningoutpost.dexdrip.stats.StatsResult)2 PermissionUtil (com.quran.labs.androidquran.service.util.PermissionUtil)2 QuranFileUtils (com.quran.labs.androidquran.util.QuranFileUtils)2 QuranScreenInfo (com.quran.labs.androidquran.util.QuranScreenInfo)2 QuranSettings (com.quran.labs.androidquran.util.QuranSettings)2 File (java.io.File)2