Google Cloud IoT Core is being retired on August 16, 2023. Contact your Google Cloud account team for more information.

ConnectionCallback (iotcore 1.0.0 API)

Stay organized with collections Save and categorize content based on your preferences.
com.google.android.things.iotcore

Class ConnectionCallback



  • public abstract class ConnectionCallback
    extends Object
    Callback interface to receive information about the status of the Cloud IoT Core connection.
    • Field Detail

      • REASON_UNKNOWN

        public static final int REASON_UNKNOWN
        Could not determine the source of the error.
        See Also:
        Constant Field Values
      • REASON_NOT_AUTHORIZED

        public static final int REASON_NOT_AUTHORIZED
        The parameters used to connect to Cloud IoT Core were invalid.
        See Also:
        Constant Field Values
      • REASON_CONNECTION_LOST

        public static final int REASON_CONNECTION_LOST
        The device lost connection to Cloud IoT Core.
        See Also:
        Constant Field Values
      • REASON_CONNECTION_TIMEOUT

        public static final int REASON_CONNECTION_TIMEOUT
        Timeout occurred while connecting to the MQTT bridge.
        See Also:
        Constant Field Values
      • REASON_CLIENT_CLOSED

        public static final int REASON_CLIENT_CLOSED
        The client closed the connection.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ConnectionCallback

        public ConnectionCallback()
    • Method Detail

      • onConnected

        public abstract void onConnected()
        Invoked when the Cloud IoT Core connection is established.
      • onDisconnected

        public abstract void onDisconnected(int reason)
        Invoked when the Cloud IoT Core connection is lost.
        Parameters:
        reason - the reason the connection was lost