Android Open Source - simple-dash Connectivity Event






From Project

Back to project page simple-dash.

License

The source code is released under:

MIT License

If you think the Android project simple-dash 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 org.bmdtech.simpledash.event;
/*from   ww w .  java  2s . co  m*/
import org.joda.time.DateTime;

public class ConnectivityEvent implements BaseEvent {

    private final Type type;
    private final DateTime timestamp;

    public ConnectivityEvent(Type type) {
        this.type = type;
        this.timestamp = DateTime.now();
    }

    // convenience method
    public String getMessage() {
        return type.getMessage();
    }

    public Type getType() {
        return type;
    }

    @Override
    public DateTime getTimestamp() {
        return timestamp;
    }

    public static enum Type {
        OPEN("Connected!"),
        ERROR("Connection error, will retry..."),
        RETRY("Retrying connection..."),
        TIMEOUT("Connection timed out, will retry..."),
        CLOSED("Connection closed, will retry...");

        private String message;

        Type(String message) {
            this.message = message;
        }

        public String getMessage() {
            return message;
        }
    }

}




Java Source Code List

org.bmdtech.simpledash.SimpleDashApp.java
org.bmdtech.simpledash.activity.MainActivity.java
org.bmdtech.simpledash.activity.SettingsActivity.java
org.bmdtech.simpledash.activity.UpdatableActivity.java
org.bmdtech.simpledash.event.BaseEvent.java
org.bmdtech.simpledash.event.ConnectivityEvent.java
org.bmdtech.simpledash.event.TelemetryEvent.java
org.bmdtech.simpledash.handler.AndroidMessageHandler.java
org.bmdtech.simpledash.telemetry.TelemetryConnector.java
org.bmdtech.simpledash.utils.Logging.java
org.bmdtech.simpledash.utils.SpeedUnit.java
org.bmdtech.simpledash.utils.Validators.java